Exemple #1
0
 function saveMe($checkUserData = true, $output = false)
 {
     $allowedUsers = Environment::getS("allowedUsers", null);
     if ($allowedUsers !== null and $this->A("isAdmin") == "0") {
         $AC = anyC::get("User", "isAdmin", "0");
         $AC->addAssocV3("UserID", "!=", $this->getID());
         $AC->lCV3();
         if ($AC->numLoaded() >= $allowedUsers) {
             Red::errorD("Sie können keine weiteren Benutzer ohne Admin-Rechte anlegen. Bitte wenden Sie sich an den Support.");
         }
     }
     $U = new User($this->ID);
     $U->loadMe(false);
     if (mUserdata::getGlobalSettingValue("encryptionKey") == null and Session::isUserAdminS()) {
         mUserdata::setUserdataS("encryptionKey", Util::getEncryptionKey(), "eK", -1);
     }
     if ($this->A->SHApassword != "") {
         $this->A->SHApassword = sha1($this->A->SHApassword);
     } else {
         $this->A->SHApassword = $U->A("SHApassword");
     }
     if ($checkUserData) {
         mUserdata::checkRestrictionOrDie("cantEdit" . str_replace("GUI", "", get_class($this)));
     }
     $this->loadAdapter();
     $this->Adapter->saveSingle2($this->getClearClass(get_class($this)), $this->A);
     if ($output) {
         Red::messageSaved();
     }
 }
Exemple #2
0
 function saveMe($checkUserData = true, $output = false)
 {
     parent::saveMe($checkUserData, false);
     $_SESSION["DBData"] = $_SESSION["S"]->getDBData();
     if (PHYNX_MAIN_STORAGE == "MySQL") {
         $DB = new DBStorage();
     } else {
         $DB = new DBStorageU();
     }
     Red::messageSaved();
 }
 function saveMe($checkUserData = true, $output = false)
 {
     Aspect::joinPoint("before", $this, get_class($this) . "::saveMe", $this->A);
     if ($checkUserData) {
         mUserdata::checkRestrictionOrDie("cantEdit" . str_replace("GUI", "", get_class($this)));
     }
     $this->loadAdapter();
     $this->Adapter->saveSingle2($this->getClearClass(get_class($this)), clone $this->A);
     if ($output) {
         Red::messageSaved();
     }
 }
 public function setUserdata($name, $wert, $typ = "", $UserID = 0, $echoSaved = false)
 {
     if ($UserID != 0 and $_SESSION["S"]->isUserAdmin() == "0") {
         echo "Only an admin-user can change Userdata of other users!";
         exit;
     }
     if ($typ == "uRest" and $_SESSION["S"]->isUserAdmin() == "0") {
         echo "Only an admin-user can change restrictions!";
         exit;
     }
     if ($UserID == 0) {
         $UserID = $_SESSION["S"]->getCurrentUser()->getID();
     }
     $UD = $this->getUserdata($name, $UserID);
     if ($UD == null) {
         $nUD = new Userdata(-1);
         $nUDA = $nUD->newAttributes();
         $nUDA->UserID = $UserID;
         $nUDA->name = $name;
         $nUDA->wert = $wert;
         $nUDA->typ = $typ;
         $nUD->setA($nUDA);
         $nUD->newMe();
         $this->collector[] = $nUD;
     } else {
         $UD->saveNewValue($wert);
     }
     if ($echoSaved) {
         Red::messageSaved();
     }
 }
Exemple #5
0
 public function saveAppServer($value)
 {
     mUserdata::setUserdataS("AppServer", $value, "", -1);
     Red::messageSaved();
 }