function CartAdmin($row) { Module::Module($row); if (User::have_permit(ADMIN_ITEM)) { $cmd = Url::get('cmd'); switch ($cmd) { case 'delete': if (User::is_admin()) { $id = Url::get('id', 0); if ($id) { DB::delete("cart", "id={$id}"); } } Url::redirect_current(); break; case 'edit': require_once 'forms/CartEdit.php'; $this->add_form(new CartEditForm()); break; case '': default: require_once 'forms/CartAdmin.php'; $this->add_form(new CartAdminForm()); break; } } else { Url::access_denied(); } }
function ManageUserLock($row) { CGlobal::$website_title = 'Quản lý thành viên bị khóa'; Module::Module($row); if (User::have_permit(ADMIN_USER)) { switch (Url::get('cmd')) { case 'unban_nick': $id = (int) Url::get('id', 0); $user_id = (int) Url::get('user_id', 0); if ($id) { DB::update('user', array('block_time' => 0), 'id="' . $user_id . '"'); DB::update('user_lock', array('unlock_time' => TIME_NOW, 'unlock_user' => User::user_name()), 'id = ' . $id); User::getUser($id, 0, 1); } Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'cmd', 'id', 'lock_die_all', 'hd_ac'))); break; default: require_once 'forms/ManageUserLock.php'; $this->add_form(new ListUserLockForm()); break; } } else { Url::access_denied(); } }
function FeedbackAdmin($row) { Module::Module($row); CGlobal::$website_title = AZNet::$page['title']; if (User::is_admin()) { $cmd = Url::get('cmd'); switch ($cmd) { case 'delete': $this->add_form(new DeleteFeedBackForm()); break; case 'exam': $this->add_form(new ExmamFeedBackForm()); break; case 'unexam': $this->add_form(new UnexmamFeedBackForm()); break; case 'reply': require_once "forms/FeedbackReply.php"; $this->add_form(new FeedbackReplyForm()); break; default: require_once "forms/FeedbackAdmin.php"; $this->add_form(new FeedbackAdminForm()); break; } } }
function Register($row) { Module::Module($row); switch (Url::get('cmd')) { case 'create_image': require_once 'forms/create_image.php'; break; case 'check_user': $this->check_user(); exit; case 'check_email': $this->check_email(); exit; case 'check_security_code': $this->check_security_code(); exit; case 'check_email_format': $this->check_email_format(); exit; default: require_once 'forms/register.php'; $this->add_form(new RegisterForm()); break; } }
function ManageFilter($row) { Module::Module($row); if (!class_exists('eCateElectronic')) { require_once ROOT_PATH . 'core/eCate.php'; } if (User::have_permit(ADMIN_CATEGORY)) { $cmd = Url::get('cmd'); switch ($cmd) { case 'add': require_once 'forms/ManageFilterAdd.php'; $this->add_form(new ManageFilterAddForm()); break; case 'edit': require_once 'forms/ManageFilterEdit.php'; $this->add_form(new ManageFilterEditForm()); break; case 'sync': require_once 'forms/ManageFilterSync.php'; $this->add_form(new ManageFilterSyncForm()); break; default: require_once 'forms/ManageFilter.php'; $this->add_form(new ManageFilterForm()); break; } } else { die('die'); } }
function AdminUsers($row) { Module::Module($row); if (User::is_admin()) { $cmd = Url::get('cmd'); switch ($cmd) { case "edit_user": case "add_user": require_once 'forms/detail.php'; $this->add_form(new AdminUserDetail()); break; case "list_users": require_once 'forms/list.php'; $this->add_form(new AdminListUsersForm()); break; case "delete_user": $id = Url::get('id'); if (!is_numeric($id)) { Url::redirect('admin_users'); return; } break; } } else { Url::access_denied(); } }
function SignIn($row) { Module::Module($row); if (User::is_login()) { if ($data = Session::get('user_data') and $data['home_page']) { Url::redirect_url($data['home_page']); } else { Url::redirect('home'); } } else { // xoa toan bo du lieu dang co truoc khi dang nhap if (Session::is_set('user_id')) { $id = Session::get('user_id'); DB::update('account', array('last_online_time' => time()), 'id=\'' . $id . '\''); setcookie('user_id', "", time() - 3600); Session::destroy('user_id'); } //if(URL::get("m")== "mobile"){ // require_once 'forms/mlogin.php'; // $this->add_form(new SignInmForm); //}else{ require_once 'forms/sign_in.php'; $this->add_form(new SignInForm()); //} } }
function AdminNews($row) { Module::Module($row); if (User::is_admin()) { $cmd = Url::get('cmd'); switch ($cmd) { case "edit": case "add_item": require_once 'forms/detail.php'; $this->add_form(new AdminNewsDetail()); break; case "delete": $url = urldecode(Url::get('url')); $id = Url::get('id'); if (!is_numeric($id)) { Url::redirect('admin_news_item'); return; } DB::delete_id('news_item', $id); eb_memcache::do_remove('news_item:' . $id); Url::redirect_url($url); break; default: require_once 'forms/list.php'; $this->add_form(new AdminNewsForm()); break; } } else { Url::access_denied(); } }
function ImportExcel($row) { if (User::have_permit(array(ADMIN_ITEM))) { Module::Module($row); $cmd = Url::get('cmd'); switch ($cmd) { case 'download': $file_src = DATA_PATH . "AzNet.xls"; if (file_exists(ROOT_PATH . $file_src)) { $ext = AZLib::getExtension($file_src); if ($ext && strlen($ext) <= 5) { $ext_app = substr($ext, 1); header("Content-type: application/{$ext_app}"); header("Content-Disposition: attachment; filename=" . date("Y.m.d-H\\hi", TIME_NOW) . "_ANS_Products{$ext}"); readfile(ROOT_PATH . $file_src); exit; } } header("HTTP/1.0 404 Not Found"); echo "<h1>404 - Not Found!<br />Return to <a href='" . WEB_ROOT . "'>" . WEB_NAME . "</a></h1>"; exit; break; default: require_once 'forms/ImportExcel.php'; $this->add_form(new ImportExcelForm()); break; } } else { Url::access_denied(); } }
function ManageSupport($row) { Module::Module($row); if (User::is_admin() || User::have_permit(support_all_perm)) { CGlobal::$website_title = 'Quản lý thư góp ý của khách hàng'; switch (Url::get('cmd')) { case 'delete': DB::query('DELETE FROM support WHERE id=' . EClassApi::getParam('id')); Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'cmd', 'id'))); break; case "edit": /*case "add": require_once 'forms/edit.php'; $this->add_form(new EditBadWordForm()); break;*/ /*case "add": require_once 'forms/edit.php'; $this->add_form(new EditBadWordForm()); break;*/ default: require_once 'forms/list.php'; $this->add_form(new ManageSupportForm()); break; } } else { Url::access_denied(); } }
function NewsAdminCats($row) { Module::Module($row); if (!User::have_permit(ADMIN_NEWS)) { Url::access_denied(); } switch (Url::get('cmd')) { case 'delete': $this->add_form(new DeleteNewsCatForm()); break; case 'move_down': case 'move_up': $this->add_form(new MoveNewsCatForm()); break; case 'move_home': case 'move_end': $this->add_form(new MoveHomeNewsCatForm()); break; case 'edit': require_once 'forms/NewsAdminCatsEdit.php'; $this->add_form(new NewsAdminCatsEditForm()); break; case 'add': require_once 'forms/NewsAdminCatsAdd.php'; $this->add_form(new NewsAdminCatsAddForm()); break; default: require_once 'forms/NewsAdminCats.php'; $this->add_form(new NewsAdminCatsForm()); } }
function RegisterSuccess($row) { Module::Module($row); switch (Url::get('cmd')) { case 'notify': //Thông báo kích hoạt tài khoản (nếu bật chế độ cần kích hoạt - USER_ACTIVE_ON = true ) if (!User::is_login() && USER_ACTIVE_ON) { require_once 'forms/notify.php'; $this->add_form(new NotifyForm()); } else { Url::redirect_current(); } break; case 'active': //Kích hoạt tài khoản if (!User::is_login() && USER_ACTIVE_ON) { require_once 'forms/active.php'; $this->add_form(new ActiveForm()); } else { Url::redirect('profile', array('user_id' => User::id(), 'user_name' => User::user_name())); } break; case 'activated': default: require_once 'forms/register_success.php'; $this->add_form(new RegisterSuccessForm()); break; } }
function DocumentAdmin($row) { Module::Module($row); if (User::is_admin()) { $cmd = Url::get('cmd'); require_once "forms/DocumentAdmin.php"; switch ($cmd) { case 'delete': $this->add_form(new Deletedocument()); break; case 'change': $this->add_form(new PublicdocumentForm()); break; case 'add': $this->add_form(new AddDocumentForm()); break; case 'edit': $this->add_form(new EditDocumentForm()); break; default: $this->add_form(new ListdocumentForm()); break; } } else { Url::access_denied(); } }
function AdminBanner($row) { Module::Module($row); if (User::is_admin()) { switch (Url::get('cmd')) { case 'remove_banner': $id = Url::get('id', 0); if (empty($id)) { Url::redirect_url('admin_banner.html'); exit; } Banner::delete_banner($id); Url::redirect_url('admin_banner.html'); break; case 'edit_banner': require_once 'forms/EditBanner.php'; $this->add_form(new EditBannerForm()); break; case 'list_banner': require_once 'forms/ListBanner.php'; $this->add_form(new ListBannerForm()); break; default: require_once 'forms/ListBanner.php'; $this->add_form(new ListBannerForm()); break; } } else { Url::access_denied(); } }
function __construct($row) { Module::Module($row); CGlobal::$adminRegion = FALSE; require_once 'forms/list.php'; $this->add_form(new SeoForm()); }
function Feedback($row) { Module::Module($row); CGlobal::$website_title = AZNet::$page['title']; require_once "forms/FeedbackSend.php"; $this->add_form(new FeedbackSendForm()); }
function FilterMenuSearch($row) { Module::Module($row); AZLib::getFilters(); require_once 'forms/FilterMenuSearch.php'; $this->add_form(new FilterMenuSearchForm()); }
function ListItem($row) { Module::Module($row); CGlobal::$website_title = AZLib::titlePath(CGlobal::$curCategory); require_once 'forms/ListItem.php'; $this->add_form(new ListItemForm()); }
function Signin($row) { Module::Module($row); switch (Url::get('cmd')) { case 'check_account': $this->check_account(); exit; case 'check_email': $this->check_email(); exit; case 'check_security_code': $this->check_security_code(); exit; case 'check_email_format': $this->check_email_format(); exit; default: if (!User::is_login()) { require_once 'forms/signin.php'; $this->add_form(new SigninForm()); } else { $href = base64_decode(Url::get('href')); if ($href) { $href = str_replace('SID=' . $_COOKIE['PHPSESSID'], '', $href); Url::redirect_url($href); } else { Url::redirect(); } } break; } }
function AdminPromotion($row) { Module::Module($row); if (User::have_permit(ADMIN_ADV)) { switch (Url::get('cmd')) { case 'edit': $promo = urldecode(Url::get('name')); if ($promo && is_dir(ROOT_PATH . 'promotion/' . $promo . '/')) { $this->add_form(new EditPromotionForm()); } else { Url::redirect_current(); } break; case 'delete': $promo = urldecode(Url::get('name')); if ($promo && is_dir(ROOT_PATH . 'promotion/' . $promo . '/')) { AZLib::delDir(ROOT_PATH . 'promotion/' . $promo . '/'); } Url::redirect_current(); break; default: $this->add_form(new AdminPromotionForm()); break; } } else { Url::access_denied(); } }
function PostItem($row) { Module::Module($row); if (User::is_login()) { if (!User::have_permit(ADMIN_ITEM) || User::is_block()) { Url::access_denied(); } else { if (Url::get('cmd') == 'edit') { if (Url::get('id')) { require_once 'forms/EditItemForm.php'; $this->add_form(new EditItemForm()); return; } } if (Url::get('cmd') != '') { Url::redirect_current(); } require_once 'forms/PostItemForm.php'; $this->add_form(new PostItemForm()); } } else { AZLib::check_uri(); Url::redirect_url('?page=sign_in&href=' . base64_encode(CGlobal::$query_string)); } }
function PublicSurveyAdmin($row) { Module::Module($row); CGlobal::$website_title = AZNet::$page['title']; if (User::is_admin()) { $cmd = Url::get('cmd', 'list'); switch ($cmd) { case 'delete': $this->add_form(new DeleteSurveyForm()); break; case 'edit': $this->add_form(new EditSurveyForm()); break; case 'add': $this->add_form(new AddSurveyForm()); break; case 'publish': case 'unpublish': $this->add_form(new SubmitLink()); break; default: $this->add_form(new ListSurveyForm()); break; } } }
function Map($row) { Module::Module($row); CGlobal::$website_title = AZNet::$page['title']; require_once "forms/MapView.php"; $this->add_form(new MapViewForm()); }
function ForgotPassword($row) { Module::Module($row); $user_id = (int) Url::get('id'); if ($user_id) { $user = DB::fetch("SELECT user_name,email FROM user WHERE id={$user_id}"); if ($user && md5($user['user_name'] . $user['email']) == Url::get('u')) { $new_password = $this->random_string(); $user_name = $user['user_name']; $subject = 'Khôi phục mật khẩu thành công!'; $messenger = file_get_contents('templates/ForgotPassword/reset_password.html'); $message = str_replace('[[|user_name|]]', $user_name, $messenger); $message = str_replace('[[|password|]]', $new_password, $message); if (System::sendEBEmail($user['email'], $subject, $message)) { DB::update('user', array('password' => User::encode_password($new_password)), "id={$user_id}"); Url::redirect_current(array('action' => 'reset_success')); } else { Url::redirect_current(array('action' => 'reset_error')); } } else { Url::redirect('home'); } } require_once 'forms/forgot_password.php'; $this->add_form(new ForgotPasswordForm()); }
function AdminLogs($row) { Module::Module($row); if (User::is_mod() || User::have_permit('logs_all_perm')) { switch (Url::get('cmd')) { case 'list_log': $id = Url::get('id', 0); if (empty($id)) { Url::redirect_url('admin_log.html'); exit; } require_once 'forms/ListLog.php'; $this->add_form(new ListLogForm()); break; case 'list_coin': require_once 'forms/ListCoin.php'; $this->add_form(new ListCoinForm()); break; case 'extend': require_once 'forms/Extend.php'; $this->add_form(new ExtendForm()); break; default: require_once 'forms/ListLog.php'; $this->add_form(new ListLogForm()); break; } } else { Url::access_denied(); } }
function AdminNewsCategory($row) { Module::Module($row); if (User::is_admin()) { $cmd = Url::get('cmd'); switch ($cmd) { case "edit": case "add_category": require_once 'forms/detail.php'; $this->add_form(new AdminNewsCategoryDetail()); break; case "delete": $id = Url::get('id'); if (!is_numeric($id)) { Url::redirect('admin_news_category'); return; } DB::delete_id('news_category', $id); eb_memcache::do_remove('news_category/all'); eb_memcache::do_remove('news_category:' . $id); Url::redirect('admin_news_category'); break; default: require_once 'forms/list.php'; $this->add_form(new AdminNewsCategoryForm()); break; } } else { Url::access_denied(); } }
/** * ViewModule constructor * @param $name string the partName * @param $o_data object , datas to render * * @return void */ function AdminModule($name = "", $o_data = null) { define('THEME', THEME_ADMIN); $this->partName = $name; $this->data =& $o_data; parent::Module(); }
function ModuleAdmin($row){ Module::Module($row); if(User::is_root()){ if(Url::check(array('cmd'=>'delete_cache'))){ EClass::update_all_page(); require_once ROOT_PATH.'includes/enbac/dir.php'; empty_all_dir(PAGE_CACHE_DIR,true); Url::redirect_current(); } else if(Url::check(array('cmd'=>'scan'))){ require_once 'forms/scan.php'; $this->add_form(new ScanModuleForm()); } else { require_once 'forms/list.php'; $this->add_form(new ListModuleAdminForm()); } } else{ Url::access_denied(); } }
function ItemSameCategory($row) { if (CGlobal::$curCategory && Item::$item['display']) { Module::Module($row); require_once 'forms/ItemSameCategory.php'; $this->add_form(new ItemSameCategoryForm()); } }
function AdminHome($row) { if (User::is_az_team()) { Module::Module($row); require_once 'forms/AdminHome.php'; $this->add_form(new AdminHomeForm()); } }