mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Code clean-up (globals, $e107->, $mes, headers)
This commit is contained in:
@@ -2,17 +2,12 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Administration - Database Utilities
|
||||
*
|
||||
* $URL$
|
||||
* $Revision$
|
||||
* $Id$
|
||||
* $Author$
|
||||
*
|
||||
*/
|
||||
|
||||
require_once ("../class2.php");
|
||||
@@ -69,7 +64,7 @@ if(isset($_POST['exportXmlFile']))
|
||||
{
|
||||
if(exportXmlFile($_POST['xml_prefs'],$_POST['xml_tables'],$_POST['package_images']))
|
||||
{
|
||||
$mes = eMessage::getInstance();
|
||||
$mes = e107::getMessage();
|
||||
$mes->add(LAN_SUCCESS, E_MESSAGE_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -246,13 +241,6 @@ class system_tools
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private function convertUTF8Form()
|
||||
{
|
||||
$mes = e107::getMessage();
|
||||
@@ -467,7 +455,6 @@ class system_tools
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Render Options
|
||||
* @return none
|
||||
@@ -537,7 +524,7 @@ class system_tools
|
||||
// Get largest allowable file upload
|
||||
|
||||
$frm = e107::getSingleton('e_form');
|
||||
$mes = eMessage::getInstance();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
require_once(e_HANDLER.'upload_handler.php');
|
||||
$max_file_size = get_user_max_upload();
|
||||
@@ -582,7 +569,7 @@ class system_tools
|
||||
*/
|
||||
private function exportXmlForm()
|
||||
{
|
||||
$mes = eMessage::getInstance();
|
||||
$mes = e107::getMessage();
|
||||
$frm = e107::getSingleton('e_form');
|
||||
|
||||
|
||||
@@ -702,12 +689,12 @@ class system_tools
|
||||
|
||||
foreach($ret['success'] as $table)
|
||||
{
|
||||
eMessage::getInstance()->add("Inserted $table", E_MESSAGE_SUCCESS);
|
||||
e107::getMessage()->addSuccess("Inserted $table");
|
||||
}
|
||||
|
||||
foreach($ret['failed'] as $table)
|
||||
{
|
||||
eMessage::getInstance()->add("Failed to Insert $table", E_MESSAGE_ERROR);
|
||||
e107::getMessage()->addError("Failed to Insert $table");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -736,12 +723,11 @@ class system_tools
|
||||
{
|
||||
//TODO Add drop-down for editing personal perfs also. ie. user pref of self. (admin)
|
||||
|
||||
global $pref, $e107;
|
||||
global $e107;
|
||||
$frm = e107::getForm();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
|
||||
|
||||
$tp = e107::getParser();
|
||||
$pref = e107::getPref();
|
||||
|
||||
$config = ($type == 'core') ? e107::getConfig('core') : e107::getPlugConfig($type);
|
||||
|
||||
@@ -790,7 +776,7 @@ class system_tools
|
||||
foreach($spref as $key => $val)
|
||||
{
|
||||
$ptext = (is_array($val)) ? "<pre>".print_r($val, TRUE)."</pre>" : htmlspecialchars($val, ENT_QUOTES, 'utf-8');
|
||||
$ptext = $e107->tp->textclean($ptext, 80);
|
||||
$ptext = $tp->textclean($ptext, 80);
|
||||
|
||||
$text .= "
|
||||
<tr>
|
||||
@@ -824,8 +810,7 @@ class system_tools
|
||||
*/
|
||||
private function scan_override()
|
||||
{
|
||||
global $pref, $mes;
|
||||
|
||||
$pref = e107::getPref();
|
||||
$mes = e107::getMessage();
|
||||
$f = e107::getFile();
|
||||
$config = e107::getConfig();
|
||||
@@ -931,7 +916,7 @@ class system_tools
|
||||
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>".$e107->tp->toHtml($row['plugin_name'], FALSE, "defs,emotes_off")."</td>
|
||||
<td>".$tp->toHtml($row['plugin_name'], FALSE, "defs,emotes_off")."</td>
|
||||
<td>".$row['plugin_path']."</td>
|
||||
<td>";
|
||||
|
||||
@@ -1020,7 +1005,7 @@ function exportXmlFile($prefs,$tables,$package=FALSE,$debug=FALSE)
|
||||
{
|
||||
$xml = e107::getSingleton('xmlClass');
|
||||
$tp = e107::getParser();
|
||||
$mes = eMessage::getInstance();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
//TODO LANs
|
||||
|
||||
@@ -1220,7 +1205,7 @@ function verify_sql_record() // deprecated by db_verify.php ( i think).
|
||||
</form>
|
||||
";
|
||||
|
||||
$e107->ns->tablerender(DBLAN_10.SEP.DBLAN_39, $mes->render().$text);
|
||||
$ns->tablerender(DBLAN_10.SEP.DBLAN_39, $mes->render().$text);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1527,7 +1512,7 @@ function verify_sql_record() // deprecated by db_verify.php ( i think).
|
||||
</form>
|
||||
";
|
||||
|
||||
$e107->ns->tablerender(DBLAN_10.SEP.DBLAN_50, $mes->render().$text);
|
||||
$ns->tablerender(DBLAN_10.SEP.DBLAN_50, $mes->render().$text);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -107,6 +107,6 @@ $text .= "
|
||||
<div id='docs-bottom-nav'><!-- --></div>
|
||||
";
|
||||
|
||||
$e107->ns->tablerender(LAN_DOCS, $text, 'docs');
|
||||
$ns->tablerender(LAN_DOCS, $text, 'docs');
|
||||
require_once("footer.php");
|
||||
?>
|
@@ -351,7 +351,7 @@ class emotec
|
||||
</fieldset>
|
||||
</form>";
|
||||
|
||||
$e107->ns->tablerender(EMOLAN_PAGE_TITLE.SEP.LAN_EDIT.": '".$packID."'", $text);
|
||||
$ns->tablerender(EMOLAN_PAGE_TITLE.SEP.LAN_EDIT.": '".$packID."'", $text);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -2,16 +2,11 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Manage/View failed login attempts
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/fla.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
* Manage failed login attempts
|
||||
*
|
||||
*/
|
||||
require_once('../class2.php');
|
||||
@@ -137,7 +132,6 @@ $gen = new convert;
|
||||
$fla_total = $sql->db_Count('generic', '(*)', "WHERE gen_type='failed_login'");
|
||||
if(!$sql->db_Select('generic', '*', "gen_type='failed_login' ORDER BY gen_datestamp DESC LIMIT {$from},{$amount}"))
|
||||
{
|
||||
//$text = $mes->render()."<div class='center'>".FLALAN_2."</div>";
|
||||
$mes->addInfo(FLALAN_2);
|
||||
}
|
||||
else
|
||||
@@ -179,7 +173,7 @@ else
|
||||
{
|
||||
extract($fa);//FIXME kill extract()
|
||||
|
||||
$gen_chardata = str_replace(":::", "<br />", $e107->tp->toHTML($gen_chardata));
|
||||
$gen_chardata = str_replace(":::", "<br />", $tp->toHTML($gen_chardata));
|
||||
$host = e107::getIPHandler()->get_host_name(getenv($gen_ip));
|
||||
$text .= "
|
||||
<tr>
|
||||
@@ -212,8 +206,6 @@ else
|
||||
$text .= "<div class='nextprev-bar'>".$nextprev."</div>";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$ns->tablerender(ADLAN_146, $mes->render().$text);
|
||||
|
@@ -683,15 +683,15 @@ function saveMailPrefs(&$mes) // $emessage to $mes, working?
|
||||
// Allow qmail as an option as well - works much as sendmail
|
||||
if ((strpos($_POST['sendmail'],'sendmail') !== FALSE) || (strpos($_POST['sendmail'],'qmail') !== FALSE))
|
||||
{
|
||||
$temp['sendmail'] = $e107->tp->toDB($_POST['sendmail']);
|
||||
$temp['sendmail'] = $tp->toDB($_POST['sendmail']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$temp['sendmail'] = '';
|
||||
}
|
||||
$temp['smtp_server'] = $e107->tp->toDB($_POST['smtp_server']);
|
||||
$temp['smtp_username'] = $e107->tp->toDB($_POST['smtp_username']);
|
||||
$temp['smtp_password'] = $e107->tp->toDB($_POST['smtp_password']);
|
||||
$temp['smtp_server'] = $tp->toDB($_POST['smtp_server']);
|
||||
$temp['smtp_username'] = $tp->toDB($_POST['smtp_username']);
|
||||
$temp['smtp_password'] = $tp->toDB($_POST['smtp_password']);
|
||||
|
||||
$smtp_opts = array();
|
||||
switch (trim($_POST['smtp_options']))
|
||||
@@ -711,7 +711,7 @@ function saveMailPrefs(&$mes) // $emessage to $mes, working?
|
||||
|
||||
$temp['smtp_options'] = implode(',',$smtp_opts);
|
||||
|
||||
$temp['mail_sendstyle'] = $e107->tp->toDB($_POST['mail_sendstyle']);
|
||||
$temp['mail_sendstyle'] = $tp->toDB($_POST['mail_sendstyle']);
|
||||
$temp['mail_pause'] = intval($_POST['mail_pause']);
|
||||
$temp['mail_pausetime'] = intval($_POST['mail_pausetime']);
|
||||
$temp['mail_workpertick'] = intval($_POST['mail_workpertick']);
|
||||
@@ -724,17 +724,17 @@ function saveMailPrefs(&$mes) // $emessage to $mes, working?
|
||||
$temp['mail_bounce_email'] = '';
|
||||
break;
|
||||
case 'auto' :
|
||||
$temp['mail_bounce_email'] = $e107->tp->toDB($_POST['mail_bounce_email2']);
|
||||
$temp['mail_bounce_email'] = $tp->toDB($_POST['mail_bounce_email2']);
|
||||
break;
|
||||
case 'mail' :
|
||||
$temp['mail_bounce_email'] = $e107->tp->toDB($_POST['mail_bounce_email']);
|
||||
$temp['mail_bounce_email'] = $tp->toDB($_POST['mail_bounce_email']);
|
||||
$temp['mail_bounce_auto'] = intval($_POST['mail_bounce_auto']);
|
||||
break;
|
||||
}
|
||||
$temp['mail_bounce_pop3'] = $e107->tp->toDB($_POST['mail_bounce_pop3']);
|
||||
$temp['mail_bounce_user'] = $e107->tp->toDB($_POST['mail_bounce_user']);
|
||||
$temp['mail_bounce_pass'] = $e107->tp->toDB($_POST['mail_bounce_pass']);
|
||||
$temp['mail_bounce_type'] = $e107->tp->toDB($_POST['mail_bounce_type']);
|
||||
$temp['mail_bounce_pop3'] = $tp->toDB($_POST['mail_bounce_pop3']);
|
||||
$temp['mail_bounce_user'] = $tp->toDB($_POST['mail_bounce_user']);
|
||||
$temp['mail_bounce_pass'] = $tp->toDB($_POST['mail_bounce_pass']);
|
||||
$temp['mail_bounce_type'] = $tp->toDB($_POST['mail_bounce_type']);
|
||||
$temp['mail_bounce_delete'] = intval(varset($_POST['mail_bounce_delete'], 0));
|
||||
|
||||
$temp['mailout_enabled'] = implode(',',varset($_POST['mail_mailer_enabled'], ''));
|
||||
|
@@ -2,14 +2,12 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* News Administration
|
||||
*
|
||||
* $URL $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
require_once('../class2.php');
|
||||
@@ -218,7 +216,7 @@ class news_sub_ui extends e_admin_ui
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
$sql->db_Select_gen("SELECT category_id,category_name FROM #news_category");
|
||||
while($row = $sql->db_Fetch())
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$cat = $row['category_id'];
|
||||
$this->cats[$cat] = $row['category_name'];
|
||||
@@ -425,7 +423,7 @@ class news_admin_ui extends e_admin_ui
|
||||
|
||||
$sql = e107::getDb();
|
||||
$sql->db_Select_gen("SELECT category_id,category_name FROM #news_category");
|
||||
while($row = $sql->db_Fetch())
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$cat = $row['category_id'];
|
||||
$this->cats[$cat] = $row['category_name'];
|
||||
@@ -508,7 +506,7 @@ class news_admin_ui extends e_admin_ui
|
||||
if ($sql->select("submitnews", "*", "submitnews_id=".intval($id)))
|
||||
{
|
||||
|
||||
//list($id, $submitnews_name, $submitnews_email, $_POST['news_title'], $submitnews_category, $_POST['news_body'], $submitnews_datestamp, $submitnews_ip, $submitnews_auth, $submitnews_file) = $sql->db_Fetch();
|
||||
//list($id, $submitnews_name, $submitnews_email, $_POST['news_title'], $submitnews_category, $_POST['news_body'], $submitnews_datestamp, $submitnews_ip, $submitnews_auth, $submitnews_file) = $sql->fetch();
|
||||
$row = $sql->fetch();
|
||||
$_POST['news_title'] = $row['submitnews_title'];
|
||||
$_POST['news_body'] = $row['submitnews_item'];
|
||||
@@ -558,9 +556,9 @@ class news_admin_ui extends e_admin_ui
|
||||
{
|
||||
if(!isset($_POST['submit_news']))
|
||||
{
|
||||
if(e107::getDb()->db_Select('news', '*', 'news_id='.intval($_GET['id'])))
|
||||
if(e107::getDb()->select('news', '*', 'news_id='.intval($_GET['id'])))
|
||||
{
|
||||
$row = e107::getDb()->db_Fetch();
|
||||
$row = e107::getDb()->fetch();
|
||||
|
||||
// if(!isset($this->news_categories[$row['news_category']]))
|
||||
{
|
||||
@@ -1013,7 +1011,7 @@ class admin_newspost
|
||||
{
|
||||
e107::getDb()->db_Mark_Time('News Administration');
|
||||
$this->news_categories = array();
|
||||
if(e107::getDb()->db_Select('news_category', '*', (getperms('0') ? '' : 'category_manager IN ('.USERCLASS_LIST.')')))
|
||||
if(e107::getDb()->select('news_category', '*', (getperms('0') ? '' : 'category_manager IN ('.USERCLASS_LIST.')')))
|
||||
{
|
||||
$this->news_categories = e107::getDb()->db_getList('ALL', FALSE, FALSE, 'category_id');
|
||||
}
|
||||
@@ -1128,10 +1126,10 @@ class admin_newspost
|
||||
switch ($delete) {
|
||||
case 'main':
|
||||
|
||||
if ($e107->sql->db_Count('news','(*)',"news_id={$del_id}"))
|
||||
if ($sql->count('news','(*)',"news_id={$del_id}"))
|
||||
{
|
||||
e107::getEvent()->trigger("newsdel", $del_id);
|
||||
if($e107->sql->db_Delete("news", "news_id={$del_id}"))
|
||||
if($sql->delete("news", "news_id={$del_id}"))
|
||||
{
|
||||
$admin_log->log_event('NEWS_01',$del_id,E_LOG_INFORMATIVE,'');
|
||||
$this->show_message(NWSLAN_31." #".$del_id." ".NWSLAN_32, E_MESSAGE_SUCCESS);
|
||||
@@ -1149,16 +1147,16 @@ class admin_newspost
|
||||
|
||||
if(!getperms('0|7')) $this->noPermissions();
|
||||
|
||||
if (($count = $e107->sql->db_Count('news','(news_id)',"news_category={$del_id}")) === false || $count > 0)
|
||||
if (($count = $sql->count('news','(news_id)',"news_category={$del_id}")) === false || $count > 0)
|
||||
{
|
||||
$this->show_message('Category is in used in <strong>'.$count.'</strong> news items and cannot be deleted.', E_MESSAGE_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($e107->sql->db_Count('news_category','(*)',"category_id={$del_id}"))
|
||||
if ($sql->count('news_category','(*)',"category_id={$del_id}"))
|
||||
{
|
||||
e107::getEvent()->trigger("newscatdel", $del_id);
|
||||
if ($e107->sql->db_Delete("news_category", "category_id={$del_id}"))
|
||||
if ($sql->delete("news_category", "category_id={$del_id}"))
|
||||
{
|
||||
$admin_log->log_event('NEWS_02',$del_id,E_LOG_INFORMATIVE,'');
|
||||
$this->show_message(NWSLAN_33." #".$del_id." ".NWSLAN_32, E_MESSAGE_SUCCESS);
|
||||
@@ -1168,7 +1166,7 @@ class admin_newspost
|
||||
break;
|
||||
|
||||
case 'sn':
|
||||
if ($e107->sql->db_Delete("submitnews", "submitnews_id={$del_id}"))
|
||||
if ($sql->delete("submitnews", "submitnews_id={$del_id}"))
|
||||
{
|
||||
$admin_log->log_event('NEWS_03',$del_id,E_LOG_INFORMATIVE,'');
|
||||
$this->show_message(NWSLAN_34." #".$del_id." ".NWSLAN_32);
|
||||
@@ -1385,7 +1383,7 @@ class admin_newspost
|
||||
{
|
||||
$this->error = true;
|
||||
$this->show_message('mySQL Error detected!', E_MESSAGE_ERROR);
|
||||
eMessage::getInstance()->addS('mySQL error #'.e107::getDb()->getLastErrorNumber().': '.e107::getDb()->getLastErrorText(), E_MESSAGE_DEBUG);
|
||||
e107::getMessage()->addDebug('mySQL error #'.e107::getDb()->getLastErrorNumber().': '.e107::getDb()->getLastErrorText());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1518,7 +1516,7 @@ class admin_newspost
|
||||
$order = $_POST['multi_category_order'][$cid];
|
||||
$cnt += (int) e107::getDb()->db_Update('news_category', 'category_manager='.intval($val).', category_order='.intval($order).' WHERE category_id='.intval($cid));
|
||||
}
|
||||
if($cnt) eMessage::getInstance()->add(LAN_UPDATED, E_MESSAGE_SUCCESS);
|
||||
if($cnt) e107::getMessage()->addSuccess(LAN_UPDATED);
|
||||
}
|
||||
|
||||
function _observe_save_prefs()
|
||||
@@ -1704,7 +1702,7 @@ class admin_newspost
|
||||
// PREPARE SOME DATA
|
||||
// safe to pass $row as it contains username and id only (no sensitive data), user_id and user_name will be internal converted to 'id', 'name' vars
|
||||
$row['user_name'] = "<a href='".e107::getUrl()->create('user/profile/view', $row)."' title='{$row['user_name']}'>{$row['user_name']}</a>";
|
||||
$row['news_title'] = "<a href='".e107::getUrl()->create('news/view/item', $row)."'>".$e107->tp->toHTML($row['news_title'], false, 'TITLE')."</a>";
|
||||
$row['news_title'] = "<a href='".e107::getUrl()->create('news/view/item', $row)."'>".$tp->toHTML($row['news_title'], false, 'TITLE')."</a>";
|
||||
$row['category_name'] = "<a href='".e107::getUrl()->create('news/list/items', $row)."'>".$row['category_name']."</a>";
|
||||
$row['news_render_type'] = $ren_type[$row['news_render_type']];
|
||||
|
||||
@@ -1743,14 +1741,14 @@ class admin_newspost
|
||||
|
||||
|
||||
|
||||
// $newsposts = $e107->sql->db_Count('news');
|
||||
// $newsposts = $sql->count('news');
|
||||
|
||||
if ($newsposts > $amount)
|
||||
{
|
||||
// $parms = $newsposts.",".$amount.",".$this->getFrom().",".e_SELF."?".$this->getAction().'.'.($this->getSubAction() ? $this->getSubAction() : 0).'.'.$this->_sort_order.".[FROM]";
|
||||
$parms = $newsposts.",".$amount.",".$this->getFrom().",".e_SELF."?action=".$this->getAction().'&sub='.($this->getSubAction() ? $this->getSubAction() : 0).'&id='.$this->_sort_order.'&filter='.intval($_GET['filter']).'&srch='.$_GET['srch']."&frm=[FROM]";
|
||||
|
||||
$nextprev = $e107->tp->parseTemplate("{NEXTPREV={$parms}}");
|
||||
$nextprev = $tp->parseTemplate("{NEXTPREV={$parms}}");
|
||||
if ($nextprev) $text .= "<div class='nextprev-bar'>".$nextprev."</div>";
|
||||
|
||||
}
|
||||
@@ -1765,7 +1763,7 @@ class admin_newspost
|
||||
$classes = e107::getUserClass()->uc_get_classlist();
|
||||
|
||||
// Grab news Category Names;
|
||||
e107::getDb()->db_Select('news_category', '*');
|
||||
e107::getDb()->select('news_category', '*');
|
||||
$newscatarray = e107::getDb()->db_getList();
|
||||
$news_category = $news_manage = array();
|
||||
foreach($newscatarray as $val)
|
||||
@@ -1886,9 +1884,9 @@ class admin_newspost
|
||||
{
|
||||
if(!isset($_POST['submit_news']))
|
||||
{
|
||||
if(e107::getDb()->db_Select('news', '*', 'news_id='.intval($this->getId())))
|
||||
if(e107::getDb()->select('news', '*', 'news_id='.intval($this->getId())))
|
||||
{
|
||||
$row = e107::getDb()->db_Fetch();
|
||||
$row = e107::getDb()->fetch();
|
||||
|
||||
if(!isset($this->news_categories[$row['news_category']]))
|
||||
{
|
||||
@@ -1943,10 +1941,10 @@ class admin_newspost
|
||||
|
||||
if ($sub_action == "sn" && !varset($_POST['preview']))
|
||||
{
|
||||
if ($sql->db_Select("submitnews", "*", "submitnews_id=".$this->getId(), TRUE))
|
||||
if ($sql->select("submitnews", "*", "submitnews_id=".$this->getId(), TRUE))
|
||||
{
|
||||
//list($id, $submitnews_name, $submitnews_email, $_POST['news_title'], $submitnews_category, $_POST['news_body'], $submitnews_datestamp, $submitnews_ip, $submitnews_auth, $submitnews_file) = $sql->db_Fetch();
|
||||
$row = $sql->db_Fetch();
|
||||
//list($id, $submitnews_name, $submitnews_email, $_POST['news_title'], $submitnews_category, $_POST['news_body'], $submitnews_datestamp, $submitnews_ip, $submitnews_auth, $submitnews_file) = $sql->fetch();
|
||||
$row = $sql->fetch();
|
||||
$_POST['news_title'] = $row['submitnews_title'];
|
||||
$_POST['news_body'] = $row['submitnews_item'];
|
||||
$_POST['cat_id'] = $row['submitnews_category'];
|
||||
@@ -1971,8 +1969,8 @@ class admin_newspost
|
||||
|
||||
if ($sub_action == "upload" && !varset($_POST['preview']))
|
||||
{
|
||||
if ($sql->db_Select('upload', '*', "upload_id=".$this->getId())) {
|
||||
$row = $sql->db_Fetch();
|
||||
if ($sql->select('upload', '*', "upload_id=".$this->getId())) {
|
||||
$row = $sql->fetch();
|
||||
$post_author_id = substr($row['upload_poster'], 0, strpos($row['upload_poster'], "."));
|
||||
$post_author_name = substr($row['upload_poster'], (strpos($row['upload_poster'], ".")+1));
|
||||
$match = array();
|
||||
@@ -2083,8 +2081,8 @@ class admin_newspost
|
||||
if(!getperms('0') && !check_class($pref['news_editauthor']))
|
||||
{
|
||||
$auth = ($_POST['news_author']) ? intval($_POST['news_author']) : USERID;
|
||||
$e107->sql->db_Select("user", "user_name", "user_id={$auth} LIMIT 1");
|
||||
$row = $e107->sql->db_Fetch(MYSQL_ASSOC);
|
||||
$sql->select("user", "user_name", "user_id={$auth} LIMIT 1");
|
||||
$row = $sql->fetch(MYSQL_ASSOC);
|
||||
$text .= "<input type='hidden' name='news_author' value='".$auth.chr(35).$row['user_name']."' />";
|
||||
$text .= "<a href='".$e107->url->create('user/profile/view', 'name='.$row['user_name'].'&id='.$_POST['news_author'])."'>".$row['user_name']."</a>";
|
||||
}
|
||||
@@ -2109,7 +2107,7 @@ class admin_newspost
|
||||
}
|
||||
|
||||
$sql->db_Select_gen($qry);
|
||||
while($row = $sql->db_Fetch())
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
if(vartrue($_POST['news_author']))
|
||||
{
|
||||
@@ -2410,8 +2408,8 @@ class admin_newspost
|
||||
|
||||
$e107 = &e107::getInstance();
|
||||
|
||||
$_POST['news_title'] = $e107->tp->toDB($_POST['news_title']);
|
||||
$_POST['news_summary'] = $e107->tp->toDB($_POST['news_summary']);
|
||||
$_POST['news_title'] = $tp->toDB($_POST['news_title']);
|
||||
$_POST['news_summary'] = $tp->toDB($_POST['news_summary']);
|
||||
|
||||
$_POST['news_id'] = $id;
|
||||
|
||||
@@ -2450,18 +2448,18 @@ class admin_newspost
|
||||
$_POST['news_datestamp'] = time();
|
||||
}
|
||||
|
||||
$e107->sql->db_Select("news_category", "*", "category_id='".intval($_POST['cat_id'])."'");
|
||||
list($_POST['category_id'], $_POST['category_name'], $_POST['category_icon']) = $e107->sql->db_Fetch();
|
||||
$sql->select("news_category", "*", "category_id='".intval($_POST['cat_id'])."'");
|
||||
list($_POST['category_id'], $_POST['category_name'], $_POST['category_icon']) = $sql->fetch();
|
||||
|
||||
list($_POST['user_id'],$_POST['user_name']) = explode(chr(35), $_POST['news_author']);
|
||||
$_POST['news_author'] = $_POST['user_id'];
|
||||
$_POST['comment_total'] = $id ? $e107->sql->db_Count("comments", "(*)", " WHERE comment_item_id={$id} AND comment_type='0'") : 0;
|
||||
$_POST['comment_total'] = $id ? $sql->count("comments", "(*)", " WHERE comment_item_id={$id} AND comment_type='0'") : 0;
|
||||
$_PR = $_POST;
|
||||
|
||||
$_PR['news_body'] = $e107->tp->post_toHTML($_PR['news_body'],FALSE);
|
||||
$_PR['news_title'] = $e107->tp->post_toHTML($_PR['news_title'],FALSE,"emotes_off, no_make_clickable");
|
||||
$_PR['news_summary'] = $e107->tp->post_toHTML($_PR['news_summary']);
|
||||
$_PR['news_extended'] = $e107->tp->post_toHTML($_PR['news_extended']);
|
||||
$_PR['news_body'] = $tp->post_toHTML($_PR['news_body'],FALSE);
|
||||
$_PR['news_title'] = $tp->post_toHTML($_PR['news_title'],FALSE,"emotes_off, no_make_clickable");
|
||||
$_PR['news_summary'] = $tp->post_toHTML($_PR['news_summary']);
|
||||
$_PR['news_extended'] = $tp->post_toHTML($_PR['news_extended']);
|
||||
$_PR['news_file'] = $_POST['news_file'];
|
||||
$_PR['news_thumbnail'] = basename($_POST['news_thumbnail']);
|
||||
|
||||
@@ -2474,7 +2472,7 @@ class admin_newspost
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
".$e107->tp->parseTemplate('{NEWSINFO}').$ix->render_newsitem($_PR, 'return')."
|
||||
".$tp->parseTemplate('{NEWSINFO}').$ix->render_newsitem($_PR, 'return')."
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -2493,9 +2491,9 @@ class admin_newspost
|
||||
$e107 = e107::getInstance();
|
||||
|
||||
$category = array();
|
||||
if ($e107->sql->db_Select("news_category", "*", "category_id=".$this->getId()))
|
||||
if ($sql->select("news_category", "*", "category_id=".$this->getId()))
|
||||
{
|
||||
$category = $e107->sql->db_Fetch();
|
||||
$category = $sql->fetch();
|
||||
}
|
||||
|
||||
if(empty($category))
|
||||
@@ -2576,9 +2574,9 @@ class admin_newspost
|
||||
|
||||
if ($this->getSubAction() == "edit" && !isset($_POST['update_category']))
|
||||
{
|
||||
if (e107::getDb()->db_Select("news_category", "*", "category_id=".$this->getId()))
|
||||
if (e107::getDb()->select("news_category", "*", "category_id=".$this->getId()))
|
||||
{
|
||||
$category = e107::getDb()->db_Fetch();
|
||||
$category = e107::getDb()->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2957,14 +2955,14 @@ class admin_newspost
|
||||
$sql = e107::getDb();
|
||||
|
||||
$newsCat = array();
|
||||
$sql->db_Select('news_category');
|
||||
while($row = $sql->db_Fetch())
|
||||
$sql->select('news_category');
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$newsCat[$row['category_id']] = $tp->toHTML($row['category_name'],FALSE,'TITLE');
|
||||
}
|
||||
|
||||
|
||||
if ($sql->db_Select("submitnews", "*", "submitnews_id !='' ORDER BY submitnews_id DESC"))
|
||||
if ($sql->select("submitnews", "*", "submitnews_id !='' ORDER BY submitnews_id DESC"))
|
||||
{
|
||||
$text .= "
|
||||
<form action='".e_SELF."?sn' method='post'>
|
||||
@@ -2995,7 +2993,7 @@ class admin_newspost
|
||||
</thead>
|
||||
<tbody>
|
||||
";
|
||||
while ($row = $sql->db_Fetch())
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$buttext = ($row['submitnews_auth'] == 0)? NWSLAN_58 : NWSLAN_103;
|
||||
|
||||
@@ -3029,7 +3027,7 @@ class admin_newspost
|
||||
<div class='field-spacer center nowrap'>
|
||||
".$frm->admin_button("category_view_{$row['submitnews_id']}", NWSLAN_27, 'action', '', array('id'=>false, 'other'=>"onclick=\"expandit('submitted_".$row['submitnews_id']."')\""))."
|
||||
".$frm->admin_button("category_edit_{$row['submitnews_id']}", $buttext, 'action', '', array('id'=>false, 'other'=>"onclick=\"document.location='".e_SELF."?create.sn.{$row['submitnews_id']}'\""))."
|
||||
".$frm->admin_button("delete[sn_{$row['submitnews_id']}]", LAN_DELETE, 'delete', '', array('id'=>false, 'title'=>$e107->tp->toJS(NWSLAN_38." [".LAN_NEWS_45.": {$row['submitnews_id']} ]")))."
|
||||
".$frm->admin_button("delete[sn_{$row['submitnews_id']}]", LAN_DELETE, 'delete', '', array('id'=>false, 'title'=>$tp->toJS(NWSLAN_38." [".LAN_NEWS_45.": {$row['submitnews_id']} ]")))."
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -3117,7 +3115,7 @@ class admin_newspost
|
||||
$canDelete = isset($_POST['newsdeletecomments']);
|
||||
if ($result = e107::getDb()->db_Select_gen($qry))
|
||||
{
|
||||
while ($row = e107::getDb()->db_Fetch(MYSQL_ASSOC))
|
||||
while ($row = e107::getDb()->fetch(MYSQL_ASSOC))
|
||||
{
|
||||
if ($canDelete && ($row['news_allow_comments'] != 0) && ($row['c_count'] > 0)) // N.B. sense of 'news_allow_comments' is 0 = allow!!!
|
||||
{ // Delete comments
|
||||
@@ -3181,7 +3179,7 @@ class admin_newspost
|
||||
$var['pref']['perm'] = "0";
|
||||
|
||||
//TODO remove commented code before release.
|
||||
// $c = $e107->sql->db_Count('submitnews');
|
||||
// $c = $sql->count('submitnews');
|
||||
// if ($c) {
|
||||
$var['sn']['text'] = NWSLAN_47." ({$c})";
|
||||
$var['sn']['link'] = e_SELF."?action=sn";
|
||||
|
@@ -3,15 +3,12 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2012 e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Administration Area - Users
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
require_once ('../class2.php');
|
||||
|
||||
@@ -258,7 +255,7 @@ class users_admin_ui extends e_admin_ui
|
||||
// FIXME use the handler to build fields and field attributes
|
||||
// FIXME a way to load 3rd party language files for extended user fields
|
||||
e107::coreLan('user_extended');
|
||||
while ($row = $sql->db_Fetch())
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$field = "user_".$row['user_extended_struct_name'];
|
||||
$title = ucfirst(str_replace("user_","",$field));
|
||||
@@ -324,7 +321,7 @@ class users_admin_ui extends e_admin_ui
|
||||
public function ListBanTrigger($userid)
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
$message = e107::getMessage();
|
||||
$mes = e107::getMessage();
|
||||
$admin_log = e107::getAdminLog();
|
||||
$iph = e107::getIPHandler();
|
||||
|
||||
@@ -332,44 +329,44 @@ class users_admin_ui extends e_admin_ui
|
||||
if(!$sysuser->getId())
|
||||
{
|
||||
// TODO lan
|
||||
e107::getMessage()->addError('User not found.');
|
||||
$mes->addError('User not found.');
|
||||
return;
|
||||
}
|
||||
$row = $sysuser->getData();
|
||||
|
||||
if (($row['user_perms'] == "0") || ($row['user_perms'] == "0."))
|
||||
{
|
||||
$message->addWarning(USRLAN_7);
|
||||
$mes->addWarning(USRLAN_7);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($sql->update("user","user_ban='1' WHERE user_id='".$userid."' "))
|
||||
{
|
||||
$admin_log->log_event('USET_05', str_replace(array('--UID--','--NAME--'), array($row['user_id'], $row['user_name']), USRLAN_161), E_LOG_INFORMATIVE);
|
||||
$message->addSuccess("(".$userid.".".$row['user_name']." - {$row['user_email']}) ".USRLAN_8);
|
||||
$mes->addSuccess("(".$userid.".".$row['user_name']." - {$row['user_email']}) ".USRLAN_8);
|
||||
}
|
||||
if (trim($row['user_ip']) == "")
|
||||
{
|
||||
$message->addInfo(USRLAN_135);
|
||||
$mes->addInfo(USRLAN_135);
|
||||
}
|
||||
else
|
||||
{
|
||||
if($sql->count('user', '(*)', "user_ip = '{$row['user_ip']}' AND user_ban=0 AND user_id <> {$userid}") > 0)
|
||||
{
|
||||
// Other unbanned users have same IP address
|
||||
$message->addWarning(str_replace("{IP}", $iph->ipDecode($row['user_ip']), USRLAN_136));
|
||||
$mes->addWarning(str_replace("{IP}", $iph->ipDecode($row['user_ip']), USRLAN_136));
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($iph->add_ban(6, USRLAN_149.$row['user_name'].'/'.$row['user_loginname'], $row['user_ip'], USERID))
|
||||
{
|
||||
// Successful IP ban
|
||||
$message->addSuccess(str_replace("{IP}", $iph->ipDecode($row['user_ip']), USRLAN_137));
|
||||
$mes->addSuccess(str_replace("{IP}", $iph->ipDecode($row['user_ip']), USRLAN_137));
|
||||
}
|
||||
else
|
||||
{
|
||||
// IP address on whitelist
|
||||
$message->addWarning(str_replace("{IP}", $iph->ipDecode($row['user_ip']), USRLAN_150));
|
||||
$mes->addWarning(str_replace("{IP}", $iph->ipDecode($row['user_ip']), USRLAN_150));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -388,7 +385,7 @@ class users_admin_ui extends e_admin_ui
|
||||
$admin_log = e107::getAdminLog();
|
||||
$sysuser = e107::getSystemUser($userid, false);
|
||||
$userMethods = e107::getUserSession();
|
||||
$emessage = e107::getMessage();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
$uid = intval($userid);
|
||||
if ($sysuser->getId())
|
||||
@@ -406,7 +403,7 @@ class users_admin_ui extends e_admin_ui
|
||||
|
||||
$admin_log->log_event('USET_10', str_replace(array('--UID--', '--NAME--', '--EMAIL--'), array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email')), USRLAN_166), E_LOG_INFORMATIVE);
|
||||
$e_event->trigger('userfull', $row);
|
||||
$emessage->addSuccess(USRLAN_86." (#".$sysuser->getId()." : ".$sysuser->getName().' - '.$sysuser->getValue('email').")");
|
||||
$mes->addSuccess(USRLAN_86." (#".$sysuser->getId()." : ".$sysuser->getName().' - '.$sysuser->getValue('email').")");
|
||||
|
||||
$this->getTreeModel()->load(true);
|
||||
|
||||
@@ -422,18 +419,18 @@ class users_admin_ui extends e_admin_ui
|
||||
if($sysuser->email('email', $options))
|
||||
{
|
||||
// TODO lan
|
||||
$emessage->addSuccess("Email sent to: ".$sysuser->getName().' ('.$sysuser->getValue('email').')');
|
||||
$mes->addSuccess("Email sent to: ".$sysuser->getName().' ('.$sysuser->getValue('email').')');
|
||||
}
|
||||
else
|
||||
{
|
||||
$emessage->addError("Failed to send email to: ".$sysuser->getName().' ('.$sysuser->getValue('email').')');
|
||||
$mes->addError("Failed to send email to: ".$sysuser->getName().' ('.$sysuser->getValue('email').')');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO lan
|
||||
e107::getMessage()->addError('User not found.');
|
||||
$mes->addError('User not found.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -443,9 +440,11 @@ class users_admin_ui extends e_admin_ui
|
||||
*/
|
||||
public function ListLoginasTrigger($userid)
|
||||
{
|
||||
$mes = e107::getMessage();
|
||||
|
||||
if(e107::getUser()->getSessionDataAs())
|
||||
{
|
||||
e107::getMessage()->addWarning(USRLAN_AS_3);
|
||||
$mes->addWarning(USRLAN_AS_3);
|
||||
}
|
||||
elseif(e107::getUser()->loginAs($userid))
|
||||
{
|
||||
@@ -453,7 +452,7 @@ class users_admin_ui extends e_admin_ui
|
||||
$user = e107::getUser();
|
||||
|
||||
// TODO - lan
|
||||
e107::getMessage()->addSuccess('Successfully logged in as '.$sysuser->getName().' <a href="'.e_ADMIN_ABS.'users.php?mode=main&action=logoutas">[logout]</a>')
|
||||
$mes->addSuccess('Successfully logged in as '.$sysuser->getName().' <a href="'.e_ADMIN_ABS.'users.php?mode=main&action=logoutas">[logout]</a>')
|
||||
->addSuccess('Please, <a href="'.SITEURL.'" rel="external">Leave Admin</a> to browse the system as this user. Use "Logout" option in Administration to end front-end session');
|
||||
|
||||
$search = array('--UID--', '--NAME--', '--EMAIL--', '--ADMIN_UID--', '--ADMIN_NAME--', '--ADMIN_EMAIL--');
|
||||
@@ -509,11 +508,12 @@ class users_admin_ui extends e_admin_ui
|
||||
{
|
||||
$user = e107::getUser();
|
||||
$sysuser = e107::getSystemUser($userid, false);
|
||||
$mes = e107::getMessage();
|
||||
|
||||
if(!$user->checkAdminPerms('3'))
|
||||
{
|
||||
// TODO lan
|
||||
e107::getMessage()->addError("You don't have enough permissions to do this.", 'default', true);
|
||||
$mes->addError("You don't have enough permissions to do this.", 'default', true);
|
||||
|
||||
// TODO lan
|
||||
$lan = 'Security violation (not enough permissions) - Administrator --ADMIN_UID-- (--ADMIN_NAME--, --ADMIN_EMAIL--) tried to remove admin status from --UID-- (--NAME--, --EMAIL--)';
|
||||
@@ -526,20 +526,20 @@ class users_admin_ui extends e_admin_ui
|
||||
|
||||
if ($sysuser->isMainAdmin())
|
||||
{
|
||||
e107::getMessage()->addError(USRLAN_5);
|
||||
$mes->addError(USRLAN_5);
|
||||
}
|
||||
else
|
||||
{
|
||||
if($sysuser->set('user_admin', '0')->set('user_perms', '')->save())
|
||||
{
|
||||
e107::getAdminLog()->log_event('USET_09',str_replace(array('--UID--', '--NAME--', '--EMAIL--'),array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email')), USRLAN_165),E_LOG_INFORMATIVE);
|
||||
e107::getMessage()->addSuccess($sysuser->getName()." (".$sysuser->getValue('email').") ".USRLAN_6);
|
||||
$mes->addSuccess($sysuser->getName()." (".$sysuser->getValue('email').") ".USRLAN_6);
|
||||
$this->getTreeModel()->load(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO lan
|
||||
e107::getMessage()->addError('Unknown error. Action failed.');
|
||||
$mes->addError('Unknown error. Action failed.');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -560,11 +560,12 @@ class users_admin_ui extends e_admin_ui
|
||||
$user = e107::getUser();
|
||||
$sysuser = e107::getSystemUser($userid, false);
|
||||
$admin_log = e107::getAdminLog();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
if(!$user->checkAdminPerms('3'))
|
||||
{
|
||||
// TODO lan
|
||||
e107::getMessage()->addError("You don't have enough permissions to do this.", 'default', true);
|
||||
$mes->addError("You don't have enough permissions to do this.", 'default', true);
|
||||
// TODO lan
|
||||
$lan = 'Security violation (not enough permissions) - Administrator --ADMIN_UID-- (--ADMIN_NAME--, --ADMIN_EMAIL--) tried to make --UID-- (--NAME--, --EMAIL--) system admin';
|
||||
$search = array('--UID--', '--NAME--', '--EMAIL--', '--ADMIN_UID--', '--ADMIN_NAME--', '--ADMIN_EMAIL--');
|
||||
@@ -578,7 +579,7 @@ class users_admin_ui extends e_admin_ui
|
||||
if(!$sysuser->getId())
|
||||
{
|
||||
// TODO lan
|
||||
e107::getMessage()->addError("User not found.", 'default', true);
|
||||
$mes->addError("User not found.", 'default', true);
|
||||
$this->redirect('list', 'main', true);
|
||||
}
|
||||
|
||||
@@ -587,7 +588,7 @@ class users_admin_ui extends e_admin_ui
|
||||
$sysuser->set('user_admin', 1)->save(); //"user","user_admin='1' WHERE user_id={$userid}"
|
||||
$lan = str_replace(array('--UID--', '--NAME--', '--EMAIL--'), array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email')), USRLAN_164);
|
||||
$admin_log->log_event('USET_08', $lan, E_LOG_INFORMATIVE);
|
||||
e107::getMessage()->addSuccess($lan);
|
||||
$mes->addSuccess($lan);
|
||||
}
|
||||
|
||||
if($this->getPosted('update_admin')) e107::getUserPerms()->updatePerms($userid, $_POST['perms']);
|
||||
@@ -645,7 +646,7 @@ class users_admin_ui extends e_admin_ui
|
||||
if(!$sysuser->getId())
|
||||
{
|
||||
// TODO lan
|
||||
$emessage->addError('User not found.');
|
||||
$mes->addError('User not found.');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -661,7 +662,7 @@ class users_admin_ui extends e_admin_ui
|
||||
if(!$this->checkAllowed($a))
|
||||
{
|
||||
// TODO lan
|
||||
$emessage->addError('Insufficient permissions, operation aborted.');
|
||||
$mes->addError('Insufficient permissions, operation aborted.');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -714,18 +715,18 @@ class users_admin_ui extends e_admin_ui
|
||||
}
|
||||
$admin_log->log_event('USET_14', str_replace(array('--UID--','--CLASSES--'), array($id, $svar), UCSLAN_11), E_LOG_INFORMATIVE);
|
||||
|
||||
$emessage->add(nl2br($message), E_MESSAGE_SUCCESS);
|
||||
$mes->addSuccess(nl2br($message));
|
||||
}
|
||||
else
|
||||
{
|
||||
// $emessage->add("Update Failed", E_MESSAGE_ERROR);
|
||||
// $mes->add("Update Failed", E_MESSAGE_ERROR);
|
||||
if($check === false)
|
||||
{
|
||||
$sysuser->setMessages(); // move messages to the default stack
|
||||
}
|
||||
else
|
||||
{
|
||||
$emessage->addInfo(LAN_NO_CHANGE);
|
||||
$mes->addInfo(LAN_NO_CHANGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -816,14 +817,14 @@ class users_admin_ui extends e_admin_ui
|
||||
if(!$sysuser->getId())
|
||||
{
|
||||
// TODO lan
|
||||
$emessage->addError('User not found.');
|
||||
$mes->addError('User not found.');
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!$key || !$sysuser->getValue('ban'))
|
||||
{
|
||||
// TODO lan
|
||||
$emessage->addError('Missing activation key.');
|
||||
$mes->addError('Missing activation key.');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -865,11 +866,11 @@ class users_admin_ui extends e_admin_ui
|
||||
if ($check)
|
||||
{
|
||||
$admin_log->log_event('USET_11', str_replace(array('--ID--','--NAME--','--EMAIL--'), array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email')), USRLAN_167), E_LOG_INFORMATIVE);
|
||||
$emessage->addSuccess(USRLAN_140.": <a href='mailto:".$sysuser->getValue('email')."?body=".$return_address."' title=\"".LAN_USER_08."\" >".$sysuser->getName()." (".$sysuser->getValue('email').")</a> ({$lan}) ");
|
||||
$mes->addSuccess(USRLAN_140.": <a href='mailto:".$sysuser->getValue('email')."?body=".$return_address."' title=\"".LAN_USER_08."\" >".$sysuser->getName()." (".$sysuser->getValue('email').")</a> ({$lan}) ");
|
||||
}
|
||||
else
|
||||
{
|
||||
$emessage->addError(USRLAN_141.": ".$sysuser->getName().' ('.$sysuser->getValue('email').')');
|
||||
$mes->addError(USRLAN_141.": ".$sysuser->getName().' ('.$sysuser->getValue('email').')');
|
||||
}
|
||||
return $check;
|
||||
}
|
||||
@@ -886,7 +887,7 @@ class users_admin_ui extends e_admin_ui
|
||||
if(!$sysuser->getId())
|
||||
{
|
||||
// TODO lan
|
||||
$emessage->addError('User not found.', 'default', true);
|
||||
$mes->addError('User not found.', 'default', true);
|
||||
$this->redirect('list', 'main', true);
|
||||
}
|
||||
|
||||
@@ -895,12 +896,12 @@ class users_admin_ui extends e_admin_ui
|
||||
{
|
||||
// TODO lan
|
||||
$this->setParam('testSucces', $result);
|
||||
$emessage->addSuccess($email.' - Valid');
|
||||
$mes->addSuccess($email.' - Valid');
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO lan
|
||||
$emessage->addError($email.' - Invalid', 'default', true);
|
||||
$mes->addError($email.' - Invalid', 'default', true);
|
||||
$this->redirect('list', 'main', true);
|
||||
}
|
||||
|
||||
@@ -981,7 +982,7 @@ class users_admin_ui extends e_admin_ui
|
||||
if(!$sysuser->getId())
|
||||
{
|
||||
// TODO lan
|
||||
$emessage->addError('User not found.', 'default', true);
|
||||
$mes->addError('User not found.', 'default', true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1179,12 +1180,14 @@ class users_admin_ui extends e_admin_ui
|
||||
// Always show Login name and password
|
||||
//if (isset($_POST['generateloginname']))
|
||||
{
|
||||
$mes->addSuccess($message)->addSuccess(USRLAN_173.': <strong>'.htmlspecialchars($user_data['user_loginname'], ENT_QUOTES, CHARSET).'</strong>');
|
||||
$mes->addSuccess($message)
|
||||
->addSuccess(USRLAN_173.': <strong>'.htmlspecialchars($user_data['user_loginname'], ENT_QUOTES, CHARSET).'</strong>');
|
||||
}
|
||||
|
||||
//if (isset($_POST['generatepassword']))
|
||||
{
|
||||
$mes->addSuccess($message)->addSuccess(USRLAN_172.': <strong>'.htmlspecialchars($savePassword, ENT_QUOTES, CHARSET).'</strong>');
|
||||
$mes->addSuccess($message)
|
||||
->addSuccess(USRLAN_172.': <strong>'.htmlspecialchars($savePassword, ENT_QUOTES, CHARSET).'</strong>');
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1427,6 +1430,7 @@ class users_admin_ui extends e_admin_ui
|
||||
$pref = e107::getPref();
|
||||
$emessage = e107::getMessage();
|
||||
$ui = $this->getUI();
|
||||
$tp = e107::getParser();
|
||||
|
||||
$ranks = e107::getRank()->getRankData();
|
||||
$tmp = e107::getFile()->get_files(e_IMAGE.'ranks', '.*?\.(png|gif|jpg)');
|
||||
@@ -1458,7 +1462,7 @@ class users_admin_ui extends e_admin_ui
|
||||
$frm->thead($fields, array_keys($fields));
|
||||
|
||||
$info = $ranks['special'][1];
|
||||
$val = $e107->tp->toForm($info['name']);
|
||||
$val = $tp->toForm($info['name']);
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>".LAN_MAINADMIN."</td>
|
||||
@@ -1471,7 +1475,7 @@ class users_admin_ui extends e_admin_ui
|
||||
</tr>
|
||||
";
|
||||
$info = $ranks['special'][2];
|
||||
$val = $e107->tp->toForm($info['name']);
|
||||
$val = $tp->toForm($info['name']);
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>".LAN_ADMIN."</td>
|
||||
@@ -1560,7 +1564,7 @@ class users_admin_ui extends e_admin_ui
|
||||
<i><a href=\"banlist.php?".$ipd."\">".USFLAN_5."</a></i>
|
||||
|
||||
<br /><br />";
|
||||
while (list($cb_id, $cb_nick, $cb_message, $cb_datestamp, $cb_blocked, $cb_ip ) = $sql->db_Fetch())
|
||||
while (list($cb_id, $cb_nick, $cb_message, $cb_datestamp, $cb_blocked, $cb_ip ) = $sql->fetch())
|
||||
{
|
||||
$datestamp = $obj->convert_date($cb_datestamp, "short");
|
||||
$post_author_id = substr($cb_nick, 0, strpos($cb_nick, "."));
|
||||
@@ -1578,7 +1582,7 @@ class users_admin_ui extends e_admin_ui
|
||||
$text .= "<hr />";
|
||||
|
||||
$sql->db_Select("comments", "*", "comment_ip='$ipd' LIMIT 0,20");
|
||||
while (list($comment_id, $comment_item_id, $comment_author, $comment_author_email, $comment_datestamp, $comment_comment, $comment_blocked, $comment_ip) = $sql->db_Fetch())
|
||||
while (list($comment_id, $comment_item_id, $comment_author, $comment_author_email, $comment_datestamp, $comment_comment, $comment_blocked, $comment_ip) = $sql->fetch())
|
||||
{
|
||||
$datestamp = $obj->convert_date($comment_datestamp, "short");
|
||||
$post_author_id = substr($comment_author, 0, strpos($comment_author, "."));
|
||||
@@ -1703,7 +1707,7 @@ class users_admin_ui extends e_admin_ui
|
||||
}
|
||||
if ($sql->db_Select('user','user_id, user_name, user_email',"user_email='".$usr_email."' "))
|
||||
{
|
||||
$row = $sql->db_Fetch();
|
||||
$row = $sql->fetch();
|
||||
if ($sql->db_Update('user',"`user_email`='' WHERE `user_id` = '".$row['user_id']."' ") !== false)
|
||||
{
|
||||
// echo "Deleting user email {$row['user_email']} for user {$row['user_name']}, id={$row['user_id']}<br />";
|
||||
|
@@ -162,6 +162,7 @@ class admin_shortcodes
|
||||
$e107 = e107::getInstance();
|
||||
$sql = e107::getDb();
|
||||
$pref = e107::getPref();
|
||||
$ns = e107::getRender();
|
||||
|
||||
e107::plugLan('user_menu', '', true);
|
||||
|
||||
@@ -300,7 +301,7 @@ class admin_shortcodes
|
||||
if(isset($params['nomenu'])) { return $select; }
|
||||
if($select) { $text .= "<div class='center'>{$select}</div>"; }
|
||||
|
||||
return $e107->ns->tablerender(UTHEME_MENU_L2, $text, '', true);
|
||||
return $ns->tablerender(UTHEME_MENU_L2, $text, '', true);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
function custom_shortcode($parm)
|
||||
{
|
||||
global $pref;
|
||||
$pref = e107::getPref();
|
||||
$tp = e107::getParser();
|
||||
$e107 = e107::getInstance();
|
||||
$custom_query = explode('+', $parm);
|
||||
switch($custom_query[0])
|
||||
@@ -55,7 +56,7 @@ function custom_shortcode($parm)
|
||||
else
|
||||
{
|
||||
$quotes = file($qotdf_file);
|
||||
$quote = $e107->tp->toHTML($quotes[rand(0, count($quotes) -1 )], true);
|
||||
$quote = $tp->toHTML($quotes[rand(0, count($quotes) -1 )], true);
|
||||
}
|
||||
return $quote;
|
||||
break;
|
||||
@@ -90,7 +91,7 @@ function custom_shortcode($parm)
|
||||
break;
|
||||
|
||||
case 'welcomemessage':
|
||||
return $e107->tp->parseTemplate('{WMESSAGE}');
|
||||
return $tp->parseTemplate('{WMESSAGE}');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
// $Id$
|
||||
|
||||
function wmessage_shortcode($parm)
|
||||
{
|
||||
$e107 = e107::getInstance();
|
||||
@@ -42,7 +40,8 @@ function wmessage_shortcode($parm)
|
||||
if (deftrue('e_FRONTPAGE') || ($parm == 'force') || ((e_SELF == $front_url) && (($parm == 'ignore_query') || (e_QUERY == $front_qry))))
|
||||
{
|
||||
// Actually want to display a welcome message here
|
||||
global $ns;
|
||||
$ns = e107::getRender();
|
||||
$tp = e107::getParser();
|
||||
|
||||
if($cacheData = $e107cache->retrieve('wmessage'))
|
||||
{
|
||||
@@ -52,20 +51,19 @@ function wmessage_shortcode($parm)
|
||||
|
||||
if (!defined('WMFLAG'))
|
||||
{
|
||||
|
||||
$qry = "
|
||||
SELECT * FROM #generic
|
||||
WHERE gen_type ='wmessage' AND gen_intdata IN (".USERCLASS_LIST.')';
|
||||
$wmessage = array();
|
||||
$wmcaption = '';
|
||||
if($e107->sql->db_Select_gen($qry))
|
||||
if($sql->gen($qry))
|
||||
{
|
||||
while ($row = $e107->sql->db_Fetch())
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$wmessage[] = $e107->tp->toHTML($row['gen_chardata'], TRUE, 'BODY, defs', 'admin');
|
||||
$wmessage[] = $tp->toHTML($row['gen_chardata'], TRUE, 'BODY, defs', 'admin');
|
||||
if(!$wmcaption)
|
||||
{
|
||||
$wmcaption = $e107->tp->toHTML($row['gen_ip'], TRUE, 'TITLE');
|
||||
$wmcaption = $tp->toHTML($row['gen_ip'], TRUE, 'TITLE');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2,14 +2,12 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2012 e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Default Header
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
@@ -21,7 +19,9 @@ if(!defined('USER_AREA'))
|
||||
define('ADMIN_AREA',FALSE);
|
||||
|
||||
$e107 = e107::getInstance();
|
||||
$e107->sql->db_Mark_Time('(Header Top)');
|
||||
$sql = e107::getDb();
|
||||
|
||||
$sql->db_Mark_Time('(Header Top)');
|
||||
|
||||
|
||||
|
||||
@@ -579,7 +579,7 @@ echo "<body".$body_onload.">\n";
|
||||
// Header included notification, from this point header includes are not possible
|
||||
define('HEADER_INIT', TRUE);
|
||||
|
||||
$e107->sql->db_Mark_Time("Main Page Body");
|
||||
$sql->db_Mark_Time("Main Page Body");
|
||||
|
||||
//
|
||||
// K: (The rest is ignored for popups, which have no menus)
|
||||
|
@@ -2,16 +2,12 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Database utilities
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/db_table_admin_class.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -37,7 +33,7 @@ class db_table_admin
|
||||
// Return as for get_table_def
|
||||
function get_current_table($table_name, $prefix = "")
|
||||
{
|
||||
global $sql;
|
||||
$sql = e107::getDb();
|
||||
if(!isset($sql))
|
||||
{
|
||||
$sql = new db;
|
||||
@@ -673,7 +669,7 @@ class db_table_admin
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret = $sql->db_Select_gen($qry);
|
||||
$ret = $sql->gen($qry);
|
||||
}
|
||||
if ($ret === FALSE)
|
||||
{
|
||||
@@ -699,7 +695,7 @@ class db_table_admin
|
||||
{
|
||||
$createText = preg_replace('#create +table +(\w*?) +#i', 'CREATE TABLE '.$newTableName.' ', $createText);
|
||||
}
|
||||
return $e107->sql->db_Select_gen($createText);
|
||||
return $sql->gen($createText);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user