Changeset 167 for trunk


Ignore:
Timestamp:
04/23/2006 12:54:45 AM (6 years ago)
Author:
Winner
Message:

Bug fix: SET NAMES executes after load_info() in userdata. (workaround found)
Bug fix: Node contact e-mail sent without checking if logged in.
Bug fix: Node contact e-mail owner only option now is working.

Location:
trunk/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/main.php

    r157 r167  
    5353                if (get('session_lang') != '') $_SESSION['lang'] = get('session_lang'); 
    5454                language_set($this->userdata->info['language']); 
     55                // Reload user info from database using SET NAMES (workaround) 
     56                $this->userdata->load_info(); 
    5557                 
    5658                $this->html->head->add_title($lang['site_title']); 
  • trunk/includes/pages/nodes/nodes_contact.php

    r137 r167  
    3838 
    3939        function output() { 
    40                 if ($_SERVER['REQUEST_METHOD'] == 'POST' && method_exists($this, 'output_onpost_'.$_POST['form_name'])) return call_user_func(array($this, 'output_onpost_'.$_POST['form_name'])); 
    4140                global $construct, $db, $main; 
    4241                $main->header->hide = TRUE; 
    4342                $main->menu->hide = TRUE; 
    4443                $main->footer->hide = TRUE; 
     44                if (!$main->userdata->logged) { 
     45                        $main->message->set_fromlang('error', 'not_logged_in'); 
     46                        return; 
     47                } 
     48                if ($_SERVER['REQUEST_METHOD'] == 'POST' && method_exists($this, 'output_onpost_'.$_POST['form_name'])) return call_user_func(array($this, 'output_onpost_'.$_POST['form_name'])); 
    4549                $this->tpl['form_contact'] = $construct->form($this->form_contact(), __FILE__); 
    4650                $t = $db->get('id, name', 'nodes', "id = ".intval(get('node'))); 
    4751                $this->tpl['node_name'] = $t[0]['name']; 
    4852                $this->tpl['node_id'] = $t[0]['id']; 
    49                 if (!$main->userdata->logged) { 
    50                         $main->message->set_fromlang('error', 'not_logged_in'); 
    51                 } 
    5253                return template($this->tpl, __FILE__); 
    5354        } 
     
    5960                $main->footer->hide = TRUE; 
    6061                $from = $db->get('username, email', 'users', "id = '".$main->userdata->user."'"); 
    61                 $to_db = $db->get('email', 'users INNER JOIN users_nodes ON users_nodes.user_id = users.id', "users_nodes.node_id = ".intval(get('node')).($POST['email_to_type']=='owner'?" AND users_nodes.owner = 'Y'":"")); 
     62                $to_db = $db->get('email', 'users INNER JOIN users_nodes ON users_nodes.user_id = users.id', "users_nodes.node_id = ".intval(get('node')).($_POST['email_to_type']=='owner'?" AND users_nodes.owner = 'Y'":"")); 
    6263                $node = $db->get('name, id', 'nodes', "id = ".intval(get('node'))); 
    6364                $to = array(); 
Note: See TracChangeset for help on using the changeset viewer.