예제 #1
0
         $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y');
         $o->accounclassctrl = $ctrl->getAccClass($o->accountclass_id, 'N');
         $o->getInputForm("edit", $o->accountgroup, $token);
         $o->showAccountGroupTable("WHERE accountgroup_id>0 and organization_id={$defaultorganization_id}", "ORDER BY initial,defaultlevel,accountgroup_name");
     } else {
         //if can't find particular organization from database, return error message
         redirect_header("accountgroup.php", 3, "Some error on viewing your accountgroup data, probably database corrupted");
     }
     break;
     //when user press save for change existing organization data
 //when user press save for change existing organization data
 case "update":
     if ($s->check(false, $token, "CREATE_ACG")) {
         $o->updatedby = $xoopsUser->getVar('uid');
         //get current uid
         if ($o->updateAccountGroup()) {
             //if data save successfully
             redirect_header("accountgroup.php?action=edit&accountgroup_id={$o->accountgroup_id}", $pausetime, "Your data is saved.");
         } else {
             redirect_header("accountgroup.php?action=edit&accountgroup_id={$o->accountgroup_id}", $pausetime, "Warning! Can't save the data, please make sure all value is insert properly.");
         }
     } else {
         redirect_header("accountgroup.php?action=edit&accountgroup_id={$o->accountgroup_id}", $pausetime, "Warning! Can't save the data, please make sure all value is insert properly.");
     }
     break;
 case "delete":
     if ($s->check(false, $token, "CREATE_ACG")) {
         if ($o->deleteAccountGroup($o->accountgroup_id)) {
             redirect_header("accountgroup.php", $pausetime, "Data removed successfully.");
         } else {
             redirect_header("accountgroup.php?action=edit&accountgroup_id={$o->accountgroup_id}", $pausetime, "Warning! Can't delete data from database.");