From 29f23c05ea68213668da349e39b9f1289ab40f7a Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 6 Dec 2012 20:34:57 -0800 Subject: [PATCH] Some method naming cleanup. --- e107_admin/administrator.php | 2 +- e107_admin/banlist.php | 172 +++++++++++++++++++++-- e107_admin/boot.php | 56 +------- e107_admin/cpage.php | 8 +- e107_admin/download.php | 18 +-- e107_admin/emoticon.php | 4 +- e107_admin/header.php | 2 +- e107_admin/plugin.php | 17 ++- e107_admin/users_extended.php | 10 +- e107_handlers/message_handler.php | 2 +- e107_handlers/user_handler.php | 2 +- e107_plugins/banner/admin_banner.php | 5 +- e107_plugins/download/includes/admin.php | 10 +- e107_web/js/core/all.jquery.js | 4 +- 14 files changed, 215 insertions(+), 97 deletions(-) diff --git a/e107_admin/administrator.php b/e107_admin/administrator.php index 51f57bc62..cf92ed9c3 100644 --- a/e107_admin/administrator.php +++ b/e107_admin/administrator.php @@ -89,7 +89,7 @@ if (isset($_POST['del_admin']) && count($_POST['del_admin'])) exit; } - admin_update($sql -> db_Update("user", "user_admin=0, user_perms='' WHERE user_id= ".$aID), 'update', ADMSLAN_61, LAN_DELETED_FAILED, false); + e107::getMessage()->addAuto($sql -> db_Update("user", "user_admin=0, user_perms='' WHERE user_id= ".$aID), 'update', ADMSLAN_61, LAN_DELETED_FAILED, false); $logMsg = str_replace(array('--ID--', '--NAME--'),array($aID, $row['user_name']),ADMSLAN_73); $admin_log->log_event('ADMIN_02',$logMsg,E_LOG_INFORMATIVE,''); } diff --git a/e107_admin/banlist.php b/e107_admin/banlist.php index 9eb5bc8b5..316aa5abb 100644 --- a/e107_admin/banlist.php +++ b/e107_admin/banlist.php @@ -44,14 +44,166 @@ require_once(e_HANDLER.'iphandler_class.php'); // This is probably already load include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); + +/* +class banlist_admin extends e_admin_dispatcher +{ + + protected $modes = array( + + 'main' => array( + 'controller' => 'banlist_ui', + 'path' => null, + 'ui' => 'banlist_form_ui', + 'uipath' => null + ), + + ); + + + protected $adminMenu = array( + + 'main/list' => array('caption'=> LAN_MANAGE, 'perm' => 'P'), + 'main/create' => array('caption'=> LAN_CREATE, 'perm' => 'P'), + + + // 'main/prefs' => array('caption'=> LAN_PREFS, 'perm' => 'P'), + // 'main/custom' => array('caption'=> 'Custom Page', 'perm' => 'P') + + + ); + + protected $adminMenuAliases = array( + 'main/edit' => 'main/list' + ); + + protected $menuTitle = 'myplugin'; +} + + + + + +class banlist_ui extends e_admin_ui +{ + + protected $pluginTitle = 'ban'; + protected $pluginName = 'myplugin'; + protected $table = 'banlist'; + protected $pid = 'banlist_ip'; + protected $perPage = 10; + + protected $fields = array ( 'checkboxes' => array ( 'title' => '', 'type' => '', 'data' => '', 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ), + 'banlist_ip' => array ( 'title' => 'Ip', 'type' => 'text', 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'banlist_bantype' => array ( 'title' => 'Bantype', 'type' => 'method', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'banlist_datestamp' => array ( 'title' => 'LAN_DATESTAMP', 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), + 'banlist_banexpires' => array ( 'title' => 'Banexpires', 'type' => 'method', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'banlist_admin' => array ( 'title' => 'Admin', 'type' => 'boolean', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'banlist_reason' => array ( 'title' => 'Reason', 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'banlist_notes' => array ( 'title' => 'Notes', 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'options' => array ( 'title' => 'Options', 'type' => '', 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ), + ); + + protected $fieldpref = array('checkboxes', 'banlist_ip', 'banlist_bantype', 'banlist_datestamp', 'banlist_banexpires', 'banlist_reason', 'banlist_notes', 'options'); + + + + + protected = array( + 'pref_type' => array('title'=> 'type', 'type'=>'text', 'data' => 'string', 'validate' => true), + 'pref_folder' => array('title'=> 'folder', 'type' => 'boolean', 'data' => 'integer'), + 'pref_name' => array('title'=> 'name', 'type' => 'text', 'data' => 'string', 'validate' => 'regex', 'rule' => '#^[\w]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore') + ); + + + // optional + public function init() + { + + } + + + public function customPage() + { + $ns = e107::getRender(); + $text = 'Hello World!'; + $ns->tablerender('Hello',$text); + + } + + +} + + + +class banlist_form_ui extends e_admin_form_ui +{ + + + // Custom Method/Function + function banlist_bantype($curVal,$mode) + { + $frm = e107::getForm(); + + switch($mode) + { + case 'read': // List Page + return $curVal; + break; + + case 'write': // Edit Page + return $frm->text('banlist_bantype',$curVal); + break; + + case 'filter': + case 'batch': + return $array; + break; + } + } + + + // Custom Method/Function + function banlist_banexpires($curVal,$mode) + { + $frm = e107::getForm(); + + switch($mode) + { + case 'read': // List Page + return $curVal; + break; + + case 'write': // Edit Page + return $frm->text('banlist_banexpires',$curVal); + break; + + case 'filter': + case 'batch': + return $array; + break; + } + } + +} + + +new banlist_admin(); + +require_once(e_ADMIN."auth.php"); +e107::getAdminUI()->runPage(); + +require_once(e_ADMIN."footer.php"); +exit; + +*/ + $e_sub_cat = 'banlist'; require_once('auth.php'); -require_once(e_HANDLER.'form_handler.php'); -$frm = new e_form(true); +$frm = e107::getForm(); +// $frm = new e_form(true); - -require_once(e_HANDLER.'message_handler.php'); -$emessage = &eMessage::getInstance(); +$emessage = e107::getMessage(); $pref = e107::getPref(); @@ -156,7 +308,7 @@ if (isset($_POST['ban_ip'])) } if (isset($_POST['add_ban'])) { // Insert new value - can just pass an array - admin_update($sql->db_Insert('banlist', $new_vals), 'insert'); + e107::getMessage()->addAuto($sql->db_Insert('banlist', $new_vals), 'insert'); if ($_POST['entry_intent'] == 'add') { banlist_adminlog('01', $new_vals['banlist_ip']); // Write to banlist @@ -175,7 +327,7 @@ if (isset($_POST['ban_ip'])) $qry .= $spacer."`{$k}`='$v'"; $spacer = ', '; } - admin_update($sql->db_Update('banlist', $qry." WHERE banlist_ip='".$_POST['old_ip']."'")); + e107::getMessage()->addAuto($sql->db_Update('banlist', $qry." WHERE banlist_ip='".$_POST['old_ip']."'")); if ($_POST['entry_intent'] == 'edit') { banlist_adminlog('09',$new_vals['banlist_ip']); @@ -196,7 +348,7 @@ if (isset($_POST['ban_ip'])) if (($action == 'remove' || $action == 'whremove') && isset($_POST['ban_secure'])) { $sql->db_Delete('generic', "gen_type='failed_login' AND gen_ip='{$sub_action}'"); - admin_update($sql->db_Delete('banlist', "banlist_ip='{$sub_action}'"), 'delete'); + e107::getMessage()->addAuto($sql->db_Delete('banlist', "banlist_ip='{$sub_action}'"), 'delete'); if ($action == "remove") { $action = 'list'; @@ -216,7 +368,7 @@ if (($action == 'remove' || $action == 'whremove') && isset($_POST['ban_secure'] if ($action == 'newtime') { $end_time = $id ? time() + ($id*60*60) : 0; - admin_update($sql->db_Update('banlist', 'banlist_banexpires='.intval($end_time)." WHERE banlist_ip='".$sub_action."'")); + e107::getMessage()->addAuto($sql->db_Update('banlist', 'banlist_banexpires='.intval($end_time)." WHERE banlist_ip='".$sub_action."'")); banlist_adminlog('03', $sub_action); $action = 'list'; $writeBanFile = TRUE; @@ -891,7 +1043,7 @@ switch ($action) $val = ($row['banlist_datestamp'] ? strftime($pref['ban_date_format'], $row['banlist_datestamp']) : BANLAN_22); break; case 'banlist_bantype': - $val = "
".$ipAdministrator->getBanTypeString($row['banlist_bantype'], FALSE)." ".E_16_CAT_USER."
"; + $val = "
".$ipAdministrator->getBanTypeString($row['banlist_bantype'], FALSE)." ".E_16_USER."
"; break; case 'ip_reason': $val = e107::getIPHandler()->ipDecode($row['banlist_ip'])."
".$fv.": ".$row['banlist_reason']; diff --git a/e107_admin/boot.php b/e107_admin/boot.php index 4dae70b80..b80bb950c 100644 --- a/e107_admin/boot.php +++ b/e107_admin/boot.php @@ -72,61 +72,15 @@ else // TODO - This function often needs to be available BEFORE header.php is loaded. - //XXX DEPRECATED It has been copied to message_handler.php as autoMessage(); + //XXX DEPRECATED It has been copied to message_handler.php as addAuto(); -function admin_update($update, $type = 'update', $success = false, $failed = false, $output = true) +function admin_updXXate($update, $type = 'update', $success = false, $failed = false, $output = true) { - return e107::getMessage()->autoMessage($update, $type, $success , $failed , $output); - - /* - require_once (e_HANDLER."message_handler.php"); - $emessage = e107::getMessage(); - - if (($type == 'update' && $update) || ($type == 'insert' && $update !== false)) - { - $emessage->add(($success ? $success : ($type == 'update' ? LAN_UPDATED : LAN_CREATED)), E_MESSAGE_SUCCESS); - } - elseif ($type == 'delete' && $update) - { - $emessage->add(($success ? $success : LAN_DELETED), E_MESSAGE_SUCCESS); - } - elseif (!mysql_errno()) - { - if ($type == 'update') - { - $emessage->add(LAN_NO_CHANGE.' '.LAN_TRY_AGAIN, E_MESSAGE_INFO); - } - elseif ($type == 'delete') - { - $emessage->add(LAN_DELETED_FAILED.' '.LAN_TRY_AGAIN, E_MESSAGE_INFO); - } - } - else - { - switch ($type) - { - case 'insert': - $msg = LAN_CREATED_FAILED; - break; - case 'delete': - $msg = LAN_DELETED_FAILED; - break; - default: - $msg = LAN_UPDATED_FAILED; - break; - } - - $text = ($failed ? $failed : $msg." - ".LAN_TRY_AGAIN)."
".LAN_ERROR." ".mysql_errno().": ".mysql_error(); - $emessage->add($text, E_MESSAGE_ERROR); - } - - $emessage->addInfo("Using deprecated admin_update() which has been replaced by \$mes->autoMessage();"); - - if ($output) echo $emessage->render(); - return $update; - */ + e107::getMessage()->addDebug("Using deprecated admin_update () which has been replaced by \$mes->addAuto();"); + return e107::getMessage()->addAuto($update, $type, $success , $failed , $output); } + function admin_purge_related($table, $id) { $ns = e107::getRender(); diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php index 7060d51ce..0e5811734 100644 --- a/e107_admin/cpage.php +++ b/e107_admin/cpage.php @@ -1011,7 +1011,7 @@ class page_admin_ui extends e_admin_ui }*/ $mes = e107::getMessage(); - $mes->autoMessage($update, 'update', LAN_UPDATED, false, false); // Display result of update + $mes->addAuto($update, 'update', LAN_UPDATED, false, false); // Display result of update } else { // New page/menu @@ -1035,7 +1035,7 @@ class page_admin_ui extends e_admin_ui 'page_theme' => $menuname, 'page_template' => varset($_POST['page_template'],'') ); - $pid = e107::getMessage()->autoMessage($sql->db_Insert('page', $info), 'insert', $addMsg, LAN_CREATED_FAILED, false); + $pid = e107::getMessage()->addAuto($sql->db_Insert('page', $info), 'insert', $addMsg, LAN_CREATED_FAILED, false); $admin_log->log_event('CPAGE_01',$menuname.'[!br!]'.$page_title.'[!br!]'.$pauthor,E_LOG_INFORMATIVE,''); if($type) @@ -1048,7 +1048,7 @@ class page_admin_ui extends e_admin_ui 'menu_pages' => '', 'menu_path' => $pid, ); - e107::getMessage()->autoMessage($sql->db_Insert('menus', $info), 'insert', CUSLAN_52, LAN_CREATED_FAILED, false); + e107::getMessage()->addAuto($sql->db_Insert('menus', $info), 'insert', CUSLAN_52, LAN_CREATED_FAILED, false); } /*if(vartrue($_POST['page_link'])) @@ -1218,7 +1218,7 @@ class page //if(!$sql->db_Select('page', '*', "page_id={$del_id}")) return; //$row = $sql->db_Fetch(); - admin_update($sql->db_Delete("page", "page_id='{$del_id}' "), 'delete', CUSLAN_28, false, false); + e107::getMessage()->addAuto($sql->db_Delete("page", "page_id='{$del_id}' "), 'delete', CUSLAN_28, false, false); $sql->db_Delete('menus', "menu_path='$del_id'"); $e107cache->clear_sys('menus_'); $admin_log->log_event('CPAGE_03','ID: '.$del_id,E_LOG_INFORMATIVE,''); diff --git a/e107_admin/download.php b/e107_admin/download.php index 7eebf9602..f4a258f22 100644 --- a/e107_admin/download.php +++ b/e107_admin/download.php @@ -289,7 +289,7 @@ if ($action == "create") if ($delete == 'category') { - if (admin_update($sql->db_Delete('download_category', 'download_category_id='.$del_id), 'delete', DOWLAN_49." #".$del_id." ".DOWLAN_36)) + if (e107::getMessage()->addAuto($sql->db_Delete('download_category', 'download_category_id='.$del_id), 'delete', DOWLAN_49." #".$del_id." ".DOWLAN_36)) { $sql->db_Delete('download_category', 'download_category_parent='.$del_id); $admin_log->log_event('DOWNL_04',$del_id,E_LOG_INFORMATIVE,''); @@ -305,7 +305,7 @@ if ($action == 'cat') if ($delete == 'main') { - $result = admin_update($sql->db_Delete('download', 'download_id='.$del_id), 'delete', DOWLAN_27." #".$del_id." ".DOWLAN_36); + $result = e107::getMessage()->addAuto($sql->db_Delete('download', 'download_id='.$del_id), 'delete', DOWLAN_27." #".$del_id." ".DOWLAN_36); if($result) { $admin_log->log_event('DOWNL_07',$del_id,E_LOG_INFORMATIVE,''); @@ -1369,7 +1369,7 @@ class download if ($id) { // Its an edit - admin_update($sql->db_UpdateArray('download',array_merge($dlInfo,$dlMirrors),'WHERE download_id='.intval($id)), 'update', DOWLAN_2." (".$_POST['download_name'].")"); + e107::getMessage()->addAuto($sql->db_UpdateArray('download',array_merge($dlInfo,$dlMirrors),'WHERE download_id='.intval($id)), 'update', DOWLAN_2." (".$_POST['download_name'].")"); $dlInfo['download_id'] = $id; $this->downloadLog('DOWNL_06',$dlInfo,$dlMirrors); $dlInfo['download_datestamp'] = $time; // This is what 0.7 did, regardless of settings @@ -1378,7 +1378,7 @@ class download } else { - if (admin_update($download_id = $sql->db_Insert('download',array_merge($dlInfo,$dlMirrors)), 'insert', DOWLAN_1." (".$_POST['download_name'].")")) + if (e107::getMessage()->addAuto($download_id = $sql->db_Insert('download',array_merge($dlInfo,$dlMirrors)), 'insert', DOWLAN_1." (".$_POST['download_name'].")")) { $dlInfo['download_id'] = $download_id; $this->downloadLog('DOWNL_05',$dlInfo,$dlMirrors); @@ -1701,12 +1701,12 @@ class download if ($id) { - admin_update($sql->db_Update("download_category", "download_category_name='{$download_category_name}', download_category_description='{$download_category_description}', download_category_icon ='{$download_category_icon}', download_category_parent= '{$download_categoory_parent}', download_category_class='{$download_category_class}' WHERE download_category_id='{$id}'"), 'update', DOWLAN_48); + e107::getMessage()->addAuto($sql->db_Update("download_category", "download_category_name='{$download_category_name}', download_category_description='{$download_category_description}', download_category_icon ='{$download_category_icon}', download_category_parent= '{$download_categoory_parent}', download_category_class='{$download_category_class}' WHERE download_category_id='{$id}'"), 'update', DOWLAN_48); $admin_log->log_event('DOWNL_03',$download_category_name.'[!br!]'.$download_category_description,E_LOG_INFORMATIVE,''); } else { - admin_update($sql->db_Insert("download_category", "0, '{$download_category_name}', '{$download_category_description}', '{$download_category_icon}', '{$download_categoory_parent}', '{$download_category_class}', 0 "), 'insert', DOWLAN_47); + e107::getMessage()->addAuto($sql->db_Insert("download_category", "0, '{$download_category_name}', '{$download_category_description}', '{$download_category_icon}', '{$download_categoory_parent}', '{$download_category_class}', 0 "), 'insert', DOWLAN_47); $admin_log->log_event('DOWNL_02',$download_category_name.'[!br!]'.$download_category_description,E_LOG_INFORMATIVE,''); } if ($sub_action == "sn") @@ -1724,7 +1724,7 @@ class download if($delete == "mirror") { - admin_update($sql -> db_Delete("download_mirror", "mirror_id=".$del_id), delete, DOWLAN_135); + e107::getMessage()->addAuto($sql -> db_Delete("download_mirror", "mirror_id=".$del_id), delete, DOWLAN_135); $admin_log->log_event('DOWNL_14','ID: '.$del_id,E_LOG_INFORMATIVE,''); } @@ -1872,12 +1872,12 @@ class download if (isset($_POST['id'])) { - admin_update($sql -> db_Update("download_mirror", "mirror_name='{$name}', mirror_url='{$url}', mirror_image='".$tp->toDB($_POST['mirror_image'])."', mirror_location='{$location}', mirror_description='{$description}' WHERE mirror_id=".intval($_POST['id'])), 'update', DOWLAN_133); + e107::getMessage()->addAuto($sql -> db_Update("download_mirror", "mirror_name='{$name}', mirror_url='{$url}', mirror_image='".$tp->toDB($_POST['mirror_image'])."', mirror_location='{$location}', mirror_description='{$description}' WHERE mirror_id=".intval($_POST['id'])), 'update', DOWLAN_133); $admin_log->log_event('DOWNL_13','ID: '.intval($_POST['id']).'[!br!]'.$logString,E_LOG_INFORMATIVE,''); } else { - admin_update($sql -> db_Insert("download_mirror", "0, '{$name}', '{$url}', '".$tp->toDB($_POST['mirror_image'])."', '{$location}', '{$description}', 0"), 'insert', DOWLAN_134); + e107::getMessage()->addAuto($sql -> db_Insert("download_mirror", "0, '{$name}', '{$url}', '".$tp->toDB($_POST['mirror_image'])."', '{$location}', '{$description}', 0"), 'insert', DOWLAN_134); $admin_log->log_event('DOWNL_12',$logString,E_LOG_INFORMATIVE,''); } } diff --git a/e107_admin/emoticon.php b/e107_admin/emoticon.php index 25b5ced7c..a7e9a5c29 100644 --- a/e107_admin/emoticon.php +++ b/e107_admin/emoticon.php @@ -414,11 +414,11 @@ class emotec if ($sql->db_Select("core", "*", "e107_name='emote_".$packID."'")) { - admin_update($sql->db_Update("core", "`e107_value`='{$tmp}' WHERE `e107_name`='emote_".$packID."' "), 'update', EMOLAN_16, false, false); + e107::getMessage()->addAuto($sql->update("core", "`e107_value`='{$tmp}' WHERE `e107_name`='emote_".$packID."' "), 'update', EMOLAN_16, false, false); } else { - admin_update($sql->db_Insert("core", "'emote_".$packID."', '$tmp' "), 'insert', EMOLAN_16, false, false); + e107::getMessage()->addAuto($sql->insert("core", "'emote_".$packID."', '$tmp' "), 'insert', EMOLAN_16, false, false); } } diff --git a/e107_admin/header.php b/e107_admin/header.php index 20e909e71..62c0c5562 100644 --- a/e107_admin/header.php +++ b/e107_admin/header.php @@ -420,7 +420,7 @@ if ($e107_popup != 1) // legacy function show_admin_menu moved to boot.php // include admin_template.php moved to boot.php // function parse_admin moved to boot.php - // legacy function admin_update moved to boot.php + // legacy function admin_updatXXe moved to boot.php // (legacy?) function admin_purge_related moved to boot.php diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index 784794deb..2516ef68c 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -1375,8 +1375,14 @@ class pluginBuilder Select your plugin's folder ".$frm->selectbox("newplugin",$newDir)." - - "; + "; + + + $text .= " + + Create Files + ".$frm->checkbox('createFiles',1,1)." + "; /* NOT a good idea - requires the use of $_POST which would prevent browser 'go Back' navigation. if(e_DOMAIN == FALSE) // localhost. @@ -1897,6 +1903,7 @@ TEMPLATE; break; case 'varchar': + case 'tinytext': $array = array( 'text' => "Text Box", "dropdown" => "DropDown", @@ -2074,7 +2081,11 @@ TEMPLATE; $frm = e107::getForm(); $type = $val['type']; - if($type == 'VARCHAR' || $type == 'TEXT') + $strings = array('time','timestamp','datetime','year','tinyblob','blob', + 'mediumblob','longblob','tinytext','mediumtext','longtext','text','date'); + + + if(in_array(strtolower($type),$strings)) { $value = 'str'; } diff --git a/e107_admin/users_extended.php b/e107_admin/users_extended.php index 54035474d..09e2cf3b2 100755 --- a/e107_admin/users_extended.php +++ b/e107_admin/users_extended.php @@ -151,9 +151,9 @@ if (isset($_POST['add_field'])) else { - $result = $mes->autoMessage($ue->user_extended_add($ue_field_name, $tp->toDB($_POST['user_text']), intval($_POST['user_type']), $new_parms, $new_values, $tp->toDB($_POST['user_default']), intval($_POST['user_required']), intval($_POST['user_read']), intval($_POST['user_write']), intval($_POST['user_applicable']), 0, intval($_POST['user_parent'])), 'insert', EXTLAN_29, false, false); + $result = $mes->addAuto($ue->user_extended_add($ue_field_name, $tp->toDB($_POST['user_text']), intval($_POST['user_type']), $new_parms, $new_values, $tp->toDB($_POST['user_default']), intval($_POST['user_required']), intval($_POST['user_read']), intval($_POST['user_write']), intval($_POST['user_applicable']), 0, intval($_POST['user_parent'])), 'insert', EXTLAN_29, false, false); - // $result = $mes->autoMessage($ue->user_extended_add($ue_field_name, $tp->toDB($_POST['user_text']), intval($_POST['user_type']), $new_parms, $new_values, $tp->toDB($_POST['user_default']), intval($_POST['user_required']), intval($_POST['user_read']), intval($_POST['user_write']), intval($_POST['user_applicable']), 0, intval($_POST['user_parent'])), 'insert', EXTLAN_29, false, false); + // $result = $mes->addAuto($ue->user_extended_add($ue_field_name, $tp->toDB($_POST['user_text']), intval($_POST['user_type']), $new_parms, $new_values, $tp->toDB($_POST['user_default']), intval($_POST['user_required']), intval($_POST['user_read']), intval($_POST['user_write']), intval($_POST['user_applicable']), 0, intval($_POST['user_parent'])), 'insert', EXTLAN_29, false, false); if(!$result) { $message = EXTLAN_75; @@ -182,7 +182,7 @@ if (isset($_POST['update_field'])) } $upd_values = $user->make_delimited($_POST['user_values']); $upd_parms = $tp->toDB($_POST['user_include']."^,^".$_POST['user_regex']."^,^".$_POST['user_regexfail']."^,^".$_POST['user_hide']); - $result = $mes->autoMessage($ue->user_extended_modify($sub_action, $tp->toDB($_POST['user_field']), $tp->toDB($_POST['user_text']), intval($_POST['user_type']), $upd_parms, $upd_values, $tp->toDB($_POST['user_default']), intval($_POST['user_required']), intval($_POST['user_read']), intval($_POST['user_write']), intval($_POST['user_applicable']), intval($_POST['user_parent'])), 'update', EXTLAN_29, false, false); + $result = $mes->addAuto($ue->user_extended_modify($sub_action, $tp->toDB($_POST['user_field']), $tp->toDB($_POST['user_text']), intval($_POST['user_type']), $upd_parms, $upd_values, $tp->toDB($_POST['user_default']), intval($_POST['user_required']), intval($_POST['user_read']), intval($_POST['user_write']), intval($_POST['user_applicable']), intval($_POST['user_parent'])), 'update', EXTLAN_29, false, false); if($result) { $admin_log->log_event('EUF_06',$tp->toDB($_POST['user_field']).'[!br!]'.$tp->toDB($_POST['user_text']).'[!br!]'.intval($_POST['user_type']),E_LOG_INFORMATIVE,''); @@ -196,7 +196,7 @@ if (isset($_POST['update_category'])) if (preg_match('#^[\w\s]+$#', $_POST['user_field']) === 1) // Check for allowed characters { $name = trim($tp->toDB($_POST['user_field'])); - $result = $mes->autoMessage( + $result = $mes->addAuto( $sql->db_Update( "user_extended_struct", "user_extended_struct_name = '{$name}', user_extended_struct_text='".$tp->toDB($_POST['user_text'])."', user_extended_struct_read = '".intval($_POST['user_read'])."', user_extended_struct_write = '".intval($_POST['user_write'])."', user_extended_struct_applicable = '".intval($_POST['user_applicable'])."' WHERE user_extended_struct_id = '{$sub_action}'"), @@ -224,7 +224,7 @@ if (isset($_POST['add_category'])) if (preg_match('#^[\w\s]+$#', $_POST['user_field']) === 1) // Check for allowed characters { $name = $tp->toDB($_POST['user_field']); - $result = $mes->autoMessage($sql->db_Insert("user_extended_struct","'0', '{$name}', '".$tp->toDB($_POST['user_text'])."', 0, '', '', '', '".intval($_POST['user_read'])."', '".intval($_POST['user_write'])."', '0', '0', '".intval($_POST['user_applicable'])."', '0', '0'"), 'insert', EXTLAN_40, false, false); + $result = $mes->addAuto($sql->db_Insert("user_extended_struct","'0', '{$name}', '".$tp->toDB($_POST['user_text'])."', 0, '', '', '', '".intval($_POST['user_read'])."', '".intval($_POST['user_write'])."', '0', '0', '".intval($_POST['user_applicable'])."', '0', '0'"), 'insert', EXTLAN_40, false, false); if($result) { $admin_log->log_event('EUF_08',$name,E_LOG_INFORMATIVE,''); diff --git a/e107_handlers/message_handler.php b/e107_handlers/message_handler.php index 866200ad1..9b18895d2 100644 --- a/e107_handlers/message_handler.php +++ b/e107_handlers/message_handler.php @@ -820,7 +820,7 @@ class eMessage // TODO - This function often needs to be available BEFORE header.php is loaded. // It has been copied from admin_update() in e107_admin/header.php - public function autoMessage($update, $type = 'update', $success = false, $failed = false, $output = false) + public function addAuto($update, $type = 'update', $success = false, $failed = false, $output = false) { if (($type == 'update' && $update) || ($type == 'insert' && $update !== false)) diff --git a/e107_handlers/user_handler.php b/e107_handlers/user_handler.php index 2dac66fd9..da952ce73 100644 --- a/e107_handlers/user_handler.php +++ b/e107_handlers/user_handler.php @@ -1500,7 +1500,7 @@ class e_userperms } } - admin_update($sql->db_Update("user", "user_perms='{$perm}' WHERE user_id='{$modID}' "), 'update', sprintf(ADMSLAN_2, $tp->toDB($_POST['ad_name'])), false, false); + e107::getMessage()->addAuto($sql->db_Update("user", "user_perms='{$perm}' WHERE user_id='{$modID}' "), 'update', sprintf(ADMSLAN_2, $tp->toDB($_POST['ad_name'])), false, false); $logMsg = str_replace(array('--ID--', '--NAME--'),array($modID, $a_name),ADMSLAN_72).$perm; $admin_log->log_event('ADMIN_01',$logMsg,E_LOG_INFORMATIVE,''); } diff --git a/e107_plugins/banner/admin_banner.php b/e107_plugins/banner/admin_banner.php index fe612d339..a9a0604dc 100644 --- a/e107_plugins/banner/admin_banner.php +++ b/e107_plugins/banner/admin_banner.php @@ -132,14 +132,15 @@ if ($_POST['createbanner'] || $_POST['updatebanner']) $logString .= $cam.'[!br!]'.$cli.'[!br!]'.$banImage.'[!br!]'.$banURL; if ($_POST['createbanner']) { - admin_update($sql->db_Insert("banner", "0, '".$cli."', '".$cLogin."', '".$cPassword."', '".$banImage."', '".$banURL."', '".intval($_POST['impressions_purchased'])."', '{$start_date}', '{$end_date}', '".intval($_POST['banner_class'])."', 0, 0, '', '".$cam."'"), 'insert', BNRLAN_63, false, false); + e107::getMessage()->addAuto($sql->db_Insert("banner", "0, '".$cli."', '".$cLogin."', '".$cPassword."', '".$banImage."', '".$banURL."', '".intval($_POST['impressions_purchased'])."', '{$start_date}', '{$end_date}', '".intval($_POST['banner_class'])."', 0, 0, '', '".$cam."'"), 'insert', BNRLAN_63, false, false); banners_adminlog('02',$logString); } else { - admin_update($sql->db_Update("banner", "banner_clientname='".$cli."', banner_clientlogin='".$cLogin."', banner_clientpassword='".$cPassword."', banner_image='".$banImage."', banner_clickurl='".$banURL."', banner_impurchased='".intval($_POST['impressions_purchased'])."', banner_startdate='{$start_date}', banner_enddate='{$end_date}', banner_active='".intval($_POST['banner_class'])."', banner_campaign='".$cam."' WHERE banner_id=".intval($_POST['eid'])), 'update', BNRLAN_64, false, false); + e107::getMessage()->addAuto($sql->db_Update("banner", "banner_clientname='".$cli."', banner_clientlogin='".$cLogin."', banner_clientpassword='".$cPassword."', banner_image='".$banImage."', banner_clickurl='".$banURL."', banner_impurchased='".intval($_POST['impressions_purchased'])."', banner_startdate='{$start_date}', banner_enddate='{$end_date}', banner_active='".intval($_POST['banner_class'])."', banner_campaign='".$cam."' WHERE banner_id=".intval($_POST['eid'])), 'update', BNRLAN_64, false, false); banners_adminlog('03',$logString); } + unset($_POST['client_name'], $_POST['client_login'], $_POST['client_password'], $_POST['banner_image'], $_POST['click_url'], $_POST['impressions_purchased'], $start_date, $end_date, $_POST['banner_enabled'], $_POST['startday'], $_POST['startmonth'], $_POST['startyear'], $_POST['endday'], $_POST['endmonth'], $_POST['endyear'], $_POST['banner_class'], $_POST['banner_pages'], $_POST['banner_listtype']); } diff --git a/e107_plugins/download/includes/admin.php b/e107_plugins/download/includes/admin.php index 6b6b31c33..0bf8b76f5 100644 --- a/e107_plugins/download/includes/admin.php +++ b/e107_plugins/download/includes/admin.php @@ -1156,7 +1156,7 @@ $columnInfo = array( $updateArray = array_merge($dlInfo,$dlMirrors); $updateArray['WHERE'] = 'download_id='.intval($id); - $mes->autoMessage($sql->db_Update('download',$updateArray), 'update', DOWLAN_2." (".$_POST['download_name'].")"); + $mes->addAuto($sql->db_Update('download',$updateArray), 'update', DOWLAN_2." (".$_POST['download_name'].")"); $dlInfo['download_id'] = $id; $this->downloadLog('DOWNL_06',$dlInfo,$dlMirrors); @@ -1174,7 +1174,7 @@ $columnInfo = array( $mes->add($hooks, E_MESSAGE_SUCCESS); - $mes->autoMessage($download_id, 'insert', DOWLAN_1." (".$_POST['download_name'].")"); + $mes->addAuto($download_id, 'insert', DOWLAN_1." (".$_POST['download_name'].")"); $dlInfo['download_id'] = $download_id; $this->downloadLog('DOWNL_05',$dlInfo,$dlMirrors); @@ -1231,7 +1231,7 @@ $columnInfo = array( if ($delete == "mirror") { - $mes->autoMessage($sql -> db_Delete("download_mirror", "mirror_id=".$del_id), delete, DOWLAN_135); + $mes->addAuto($sql -> db_Delete("download_mirror", "mirror_id=".$del_id), delete, DOWLAN_135); $admin_log->log_event('DOWNL_14','ID: '.$del_id,E_LOG_INFORMATIVE,''); } @@ -1382,12 +1382,12 @@ $columnInfo = array( if (isset($_POST['id'])) { - $mes->autoMessage($sql -> db_Update("download_mirror", "mirror_name='{$name}', mirror_url='{$url}', mirror_image='".$tp->toDB($_POST['mirror_image'])."', mirror_location='{$location}', mirror_description='{$description}' WHERE mirror_id=".intval($_POST['id'])), 'update', DOWLAN_133); + $mes->addAuto($sql -> db_Update("download_mirror", "mirror_name='{$name}', mirror_url='{$url}', mirror_image='".$tp->toDB($_POST['mirror_image'])."', mirror_location='{$location}', mirror_description='{$description}' WHERE mirror_id=".intval($_POST['id'])), 'update', DOWLAN_133); $admin_log->log_event('DOWNL_13','ID: '.intval($_POST['id']).'[!br!]'.$logString,E_LOG_INFORMATIVE,''); } else { - $mes->autoMessage($sql -> db_Insert("download_mirror", "0, '{$name}', '{$url}', '".$tp->toDB($_POST['mirror_image'])."', '{$location}', '{$description}', 0"), 'insert', DOWLAN_134); + $mes->addAuto($sql -> db_Insert("download_mirror", "0, '{$name}', '{$url}', '".$tp->toDB($_POST['mirror_image'])."', '{$location}', '{$description}', 0"), 'insert', DOWLAN_134); $admin_log->log_event('DOWNL_12',$logString,E_LOG_INFORMATIVE,''); } } diff --git a/e107_web/js/core/all.jquery.js b/e107_web/js/core/all.jquery.js index 9a553db45..e84abfba3 100644 --- a/e107_web/js/core/all.jquery.js +++ b/e107_web/js/core/all.jquery.js @@ -34,7 +34,7 @@ $(document).ready(function() if(href == '' && $(this).attr("data-target")) { - href = $(this).attr("data-target"); + href = '#' + $(this).attr("data-target"); } @@ -47,7 +47,7 @@ $(document).ready(function() //var id = $(this).attr("href"); - $('#'+href).toggle("slow"); + $(href).toggle("slow"); return false; });