Exemplo n.º 1
0
 protected function module_register()
 {
     if ($this->module_is_logedin()) {
         header("Location:" . cls_general::create_url(array('plugin', 'users', 'action', 'profile')));
     } elseif ($this->settings['register'] == '0') {
         //new register was closed
         $msg = new msg();
         return $msg->msg('Warrning!', 'Register new user was closed by Administrator.', 'danger');
     }
     return $this->view_register();
 }
Exemplo n.º 2
0
 public function download($url)
 {
     $headers = @get_headers($url);
     if ($headers[0] == 'HTTP/1.1 404 Not Found') {
         //file not exist
         return '0';
     } else {
         //file exist going to download
         $file_name = AppPath . "upload/buffer/" . cls_general::random_string(5) . ".zip";
         echo $file_name;
         file_put_contents($file_name, file_get_contents($url));
         return $file_name;
     }
 }
Exemplo n.º 3
0
 protected function view_dashboard()
 {
     //Assign variables
     $this->raintpl->assign("BasicSettings", _('Basic Settings'));
     $this->raintpl->assign("RegionalandLanguages", _('Regional and Languages'));
     $this->raintpl->assign("Appearance", _('Appearance'));
     $this->raintpl->assign("Plugins", _('Plugins'));
     $this->raintpl->assign("Blocks", _('Blocks'));
     $this->raintpl->assign("Usersandpermissions", _('Users and permissions'));
     $this->raintpl->assign("url_regional", _('Author'));
     $this->raintpl->assign("url_appearance", cls_general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'themes')));
     $this->raintpl->assign("url_plugins", _('Author'));
     $this->raintpl->assign("url_blocks", _('Author'));
     $this->raintpl->assign("url_uap", _('Author'));
     $this->raintpl->assign("url_basic", _('Author'));
     //draw and return back content
     return array(_('Dashboard'), $this->raintpl->draw('core_dashboard', true));
 }
Exemplo n.º 4
0
 public static function core_menu()
 {
     $menus = [[cls_general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'dashboard')), _('Dashboard')], [cls_general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'settings')), _('General Settings')], [cls_general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'themes')), _('Appearance')], [cls_general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'plugins')), _('Plugins')], [cls_general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'settings')), _('Localize')]];
     return $menus;
 }
Exemplo n.º 5
0
 public static function jump_page($url, $inner_url = true)
 {
     if (!$inner_url && $url != SiteRoot) {
         $url = SiteRoot . $url;
     } elseif ($url == SiteRoot) {
         $url = SiteRoot;
     } elseif (is_array($url)) {
         $url = cls_general::create_url($url);
     }
     header("Location:{$url}");
     /* Make sure that code below does not get executed when we redirect. */
     exit;
 }
Exemplo n.º 6
0
 protected function view_profile_block($user, $admin)
 {
     $form = new ctr_form('USERS_PROFILE_BLOCK');
     $row = new ctr_row();
     $avatar = new ctr_image();
     $avatar->configure('SRC', './plugins/system/users/images/def_avatar_64.png');
     $avatar->configure('TYPE', 'img-thumbnail');
     $avatar->configure('LABEL', _('Hello') . ' ' . $user->username);
     $row->add($avatar, 12);
     $row1 = new ctr_row();
     $btn_logout = new ctr_button();
     $btn_logout->configure('NAME', 'btn_logout');
     $btn_logout->configure('LABEL', 'Sign Out!');
     $btn_logout->configure('TYPE', 'info');
     $btn_logout->configure('P_ONCLICK_PLUGIN', 'users');
     $btn_logout->configure('P_ONCLICK_FUNCTION', 'btn_logout_onclick');
     $row1->add($btn_logout, 6);
     if ($admin) {
         $btn_admin = new ctr_button();
         $btn_admin->configure('NAME', 'JUMP_ADMIN');
         $btn_admin->configure('LABEL', _('Admin panel'));
         $btn_admin->configure('HREF', cls_general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'dashboard')));
         $row1->add($btn_admin, 6);
     }
     $form->add_array(array($row, $row1));
     return array(_('User Profile'), $form->draw());
 }