function DoAction($action, $id, $params, $returnid = -1)
 {
     global $gCms;
     $smarty = $gCms->GetSmarty();
     $smarty->assign('selfregactionid', $id);
     $smarty->assign('selfregparams', $params);
     $smarty->assign('mod', $this);
     $smarty->assign($this->GetName(), $this);
     switch ($action) {
         case 'deletetempuser':
             if ($this->CheckPermission('Manage Registering Users')) {
                 $this->_DoDeleteUser($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
         case 'do_deleteusersbulk':
             if ($this->CheckPermission('Manage Registering Users')) {
                 $this->_DoDeleteBulkUsers($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
         case 'sendanotheremail':
             $this->_SendAnotherRegEmail($id, $params, $returnid);
             break;
         case 'set_reg1template':
             if ($this->CheckPermission('Modify Templates')) {
                 $this->_SetAdminReg1Template($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
         case 'set_reg2template':
             if ($this->CheckPermission('Modify Templates')) {
                 $this->_SetAdminReg2Template($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
         case 'set_emailconfirm_template':
             if ($this->CheckPermission('Modify Templates')) {
                 $this->_SetAdminEmailConfirmTemplate($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
         case 'set_emailuseredited_template':
             if ($this->CheckPermission('Modify Templates')) {
                 $this->_SetAdminEmailUserEditedTemplate($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
         case 'set_finalmessage_template':
             if ($this->CheckPermission('Modify Templates')) {
                 $this->_SetAdminFinalMessageTemplate($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
         case 'set_sendanotheremail_template':
             if ($this->CheckPermission('Modify Templates')) {
                 $this->_SetAdminSendAnotherEmailTemplate($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
             //       case 'default':
             //       case 'defaultadmin':
             //       case 'do_edituser':
             //       case 'edittempuser':
             //       case 'reguser':
             //       case 'setprefs':
             //       case 'verifyuser':
         //       case 'default':
         //       case 'defaultadmin':
         //       case 'do_edituser':
         //       case 'edittempuser':
         //       case 'reguser':
         //       case 'setprefs':
         //       case 'verifyuser':
         default:
             return parent::DoAction($action, $id, $params, $returnid);
             break;
     }
 }
 function DoAction($action, $id, $params, $returnid = -1)
 {
     $smarty = cmsms()->GetSmarty();
     $smarty->assign('feuactionid', $id);
     $smarty->assign('feuactionparams', $params);
     $smarty->assign('mod', $this);
     $smarty->assign($this->GetName(), $this);
     switch ($action) {
         case 'changesettings_url':
             break;
         case 'changesettings':
             $params['form'] = $action;
             $this->_DoUserAction($id, $params, $returnid);
             break;
         case 'lostusername':
         case 'forgotpw':
             $params['form'] = $action;
             $this->_DoUserAction($id, $params, $returnid);
             break;
         case "default":
             $this->_DoUserAction($id, $params, $returnid);
             break;
         case 'do_setchangesettingstemplate':
             if ($this->_HasSufficientPermissions('templates')) {
                 $this->_DoSetChangeSettingsTemplate($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
         case 'do_setforgotpwtemplate':
             if ($this->_HasSufficientPermissions('templates')) {
                 $this->_DoSetForgotPWTemplate($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
         case 'do_setlogintemplate':
             if ($this->_HasSufficientPermissions('templates')) {
                 $this->_DoSetLoginTemplate($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
         case 'do_setlogouttemplate':
             if ($this->_HasSufficientPermissions('templates')) {
                 $this->_DoSetLogoutTemplate($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
         case 'edituser':
             if ($this->_HasSufficientPermissions('editusers')) {
                 $this->_DisplayAdminEditUserStep1Page($id, $params, $returnid);
             } else {
                 $this->_DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
             }
             break;
         case 'admin_bulkactions':
         case 'admin_importgroup':
         case 'admin_exportgroup':
         case 'admin_logout':
         case 'admin_setviewuser_template':
         case 'admin_setlostun_template':
         case 'addgroup':
         case 'adduser':
         case 'addprop':
         case 'defaultadmin':
         case 'do_deleteprop':
         case 'do_deletegroup':
         case 'do_login':
         case 'do_adduser1':
         case 'do_adduser3':
         case 'do_deleteuser':
         case 'do_addgroup':
         case 'do_edituser3':
         case 'do_userchangesettings':
         case 'do_forgotpw':
         case 'do_setprefs':
         case 'do_edituser1':
         case 'do_admintasks':
         case 'do_lostusername':
         case 'do_verifycode':
         case 'logout':
         case 'userhistory':
         case 'verifycode':
         case 'viewuser':
         case 'do_edituser2':
         case 'do_adduser2':
         default:
             parent::DoAction($action, $id, $params, $returnid);
             break;
     }
 }
Ejemplo n.º 3
0
 public function DoAction($action, $id, $params, $returnid = -1)
 {
     switch ($action) {
         case 'do_deletecategory':
             // check permissions again
             if ($this->CheckPermission('Manage Uploads')) {
                 $delete_dir = false;
                 if (!isset($params['category_id'])) {
                     $this->SetError($this->Lang('error_missing_invalid', 'category_id'));
                     $this->RedirectToTab($id, 'categories');
                 }
                 if (isset($params['input_deletedirectory']) && $params['input_deletedirectory']) {
                     $delete_dir = true;
                 }
                 $msg = $this->_AdminDoDeleteCategory($params['category_id'], $delete_dir);
                 if ($msg) {
                     $this->SetError($msg);
                 }
                 $this->RedirectToTab($id, 'categories');
             }
             break;
         case 'do_deleteupload':
             // check permissions again
             if ($this->CheckPermission('Manage Uploads') || $this->CheckPermission('Upload Files to Uploads')) {
                 if (!isset($params['upload_id'])) {
                     $module->_DisplayErrorPage($id, $params, $returnid, $module->Lang('error_insufficientparams', 'upload_id'));
                     return;
                 }
                 $msg = $this->_AdminDoDeleteUpload($params['upload_id'], true);
                 if ($msg) {
                     $this->SetError($msg);
                 }
                 $this->RedirectToTab($id, 'files', array('input_category' => $uploadrow['upload_category_id']));
             }
             break;
         case 'updateemailtemplate':
             // check permissions again
             if ($this->CheckPermission('Modify Templates')) {
                 if (isset($params['defaultbutton'])) {
                     $fn = dirname(__FILE__) . '/templates/orig_emailnotify_template.tpl';
                     if (file_exists($fn)) {
                         $template = @file_get_contents($fn);
                         $this->SetTemplate('upload_emailtemplate', $template);
                     }
                 } else {
                     $this->SetTemplate('upload_emailtemplate', $params['templatecontent']);
                 }
                 $this->RedirectToTab($id, 'email_template', '', 'admin_templates');
             }
         case 'updatesendfileemail':
             // check permissions again
             if ($this->CheckPermission('Modify Templates')) {
                 if (isset($params['defaultbutton'])) {
                     // template used for sendfile email
                     $fn = dirname(__FILE__) . '/templates/orig_sendfilerpt_template.tpl';
                     if (file_exists($fn)) {
                         $template = @file_get_contents($fn);
                         $this->SetTemplate('upload_sendfilerpt', $template);
                     }
                 } else {
                     $this->SetTemplate('upload_sendfilerpt', $params['templatecontent']);
                 }
                 $this->RedirectToTab($id, 'email_template', '', 'admin_templates');
             }
         default:
             parent::DoAction($action, $id, $params, $returnid);
             break;
     }
 }