includes/pageprocess.php
changeset 1175 1e2c9819ede3
parent 1081 745200a9cc2a
child 1180 4829d15d2782
equal deleted inserted replaced
1174:def792dd9b1b 1175:1e2c9819ede3
   457     $edit_summary = ( strval($edit_summary) === $edit_summary ) ? $db->escape($edit_summary) : '';
   457     $edit_summary = ( strval($edit_summary) === $edit_summary ) ? $db->escape($edit_summary) : '';
   458     $minor_edit = ( $minor_edit ) ? '1' : '0';
   458     $minor_edit = ( $minor_edit ) ? '1' : '0';
   459     $date_string = enano_date(ED_DATE | ED_TIME);
   459     $date_string = enano_date(ED_DATE | ED_TIME);
   460     
   460     
   461     // Insert log entry
   461     // Insert log entry
   462     $sql = 'INSERT INTO ' . table_prefix . "logs ( time_id, date_string, log_type, action, page_id, namespace, author, page_text, edit_summary, minor_edit, page_format )\n"
   462     $sql = 'INSERT INTO ' . table_prefix . "logs ( time_id, date_string, log_type, action, page_id, namespace, author, author_uid, page_text, edit_summary, minor_edit, page_format )\n"
   463          . "  VALUES ( $time, '$date_string', 'page', 'edit', '{$this->page_id}', '{$this->namespace}', '$author', '$text', '$edit_summary', $minor_edit, '$page_format' );";
   463          . "  VALUES ( $time, '$date_string', 'page', 'edit', '{$this->page_id}', '{$this->namespace}', '$author', $session->user_id, '$text', '$edit_summary', $minor_edit, '$page_format' );";
   464     if ( !$db->sql_query($sql) )
   464     if ( !$db->sql_query($sql) )
   465     {
   465     {
   466       $this->raise_error($db->get_error());
   466       $this->raise_error($db->get_error());
   467       return false;
   467       return false;
   468     }
   468     }
   586                         . "VALUES ( '$page_id', '$namespace', '' );");
   586                         . "VALUES ( '$page_id', '$namespace', '' );");
   587     if ( !$q )
   587     if ( !$q )
   588       $db->_die('PageProcessor page creation - text stage');
   588       $db->_die('PageProcessor page creation - text stage');
   589     
   589     
   590     // Query 3: Log entry
   590     // Query 3: Log entry
   591     $db->sql_query('INSERT INTO ' . table_prefix."logs(time_id, date_string, log_type, action, author, page_id, namespace)\n"
   591     $db->sql_query('INSERT INTO ' . table_prefix."logs(time_id, date_string, log_type, action, author, author_uid, page_id, namespace)\n"
   592                    . "  VALUES ( " . time() . ", 'DEPRECATED', 'page', 'create', \n"
   592                    . "  VALUES ( " . time() . ", 'DEPRECATED', 'page', 'create', \n"
   593                    . "          '" . $db->escape($session->username) . "', '" . $db->escape($this->page_id) . "', '" . $this->namespace . "');");
   593                    . "          '" . $db->escape($session->username) . "', $session->user_id, '" . $db->escape($this->page_id) . "', '" . $this->namespace . "');");
   594     if ( !$q )
   594     if ( !$q )
   595       $db->_die('PageProcessor page creation - logging stage');
   595       $db->_die('PageProcessor page creation - logging stage');
   596     
   596     
   597     // Update the cache
   597     // Update the cache
   598     $paths->update_metadata_cache();
   598     $paths->update_metadata_cache();
  1130     global $db, $session, $paths, $template, $plugins; // Common objects
  1130     global $db, $session, $paths, $template, $plugins; // Common objects
  1131     global $lang;
  1131     global $lang;
  1132     global $email;
  1132     global $email;
  1133     
  1133     
  1134     // Log it for crying out loud
  1134     // Log it for crying out loud
  1135     $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'illegal_page\', '.time().', \'DEPRECATED\', \''.$db->escape($session->username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', \'' . $db->escape(serialize(array($this->page_id, $this->namespace))) . '\')');
  1135     $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,author_uid,edit_summary,page_text) VALUES(\'security\', \'illegal_page\', '.time().', \'DEPRECATED\', \''.$db->escape($session->username).'\', ' . $session->user_id . ', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', \'' . $db->escape(serialize(array($this->page_id, $this->namespace))) . '\')');
  1136     
  1136     
  1137     $ob = '';
  1137     $ob = '';
  1138     //$template->tpl_strings['PAGE_NAME'] = 'Access denied';
  1138     //$template->tpl_strings['PAGE_NAME'] = 'Access denied';
  1139     $template->tpl_strings['PAGE_NAME'] = htmlspecialchars( $this->title );
  1139     $template->tpl_strings['PAGE_NAME'] = htmlspecialchars( $this->title );
  1140       
  1140