示例#1
0
 public function main()
 {
     //first check for permission
     if ($this->users->is_logedin() && $this->users->has_permission('core_admin_panel')) {
         //check for that user come from login process
         if ($_GET['p'] == 'users' && $_GET['a'] == 'login') {
             //user come from login process and now should jump to default administrator page
             cls_router::jump_page(cls_general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'dashboard')));
         } else {
             //going to show content
             return $this->module_main();
         }
     } elseif (!$this->users->is_logedin()) {
         //user do not has any permission to access  to administrator area
         if ($_GET['p'] == 'users' && $_GET['a'] == 'login') {
             //show login page
             return $this->module_login_page();
         } else {
             //jump to login page
             cls_router::jump_page(cls_general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'users', 'a', 'login')));
         }
     } elseif ($this->users->has_permission('core_admin_panel') != true) {
         return $this->module_no_permission();
     }
 }
示例#2
0
 public function btn_signup_onclick($e)
 {
     //if this action requested by content mode i should reject that
     if ($e == 'content') {
         cls_router::jump_page(SiteDomain);
     }
     //check input
     if ($e['txt_username']['VALUE'] == '' || $e['txt_email']['VALUE'] == '' || $e['txt_password']['VALUE'] == '' || $e['txt_repassword']['VALUE'] == '') {
         //invalid field
         $e['RV']['MODAL'] = cls_page::show_block(_('Message'), _('Please fill out all the field that are marked with an asterisk (*).'), 'MODAL', 'type-warning');
         return $e;
     } else {
         return $this->module_btn_signup_onclick($e);
     }
 }
示例#3
0
文件: module.php 项目: MrMiM/sarkesh
 protected function module_logout($e = '')
 {
     $this->validator->delete('USERS_LOGIN');
     //if this action requested by content mode jump user to home page
     if ($e == 'content') {
         cls_router::jump_page(SiteDomain);
     } else {
         //jump page with events controller
         $e['RV']['URL'] = SiteDomain;
     }
     return $e;
 }