Ejemplo n.º 1
0
 /**
  * 
  * getRandomPassword
  * 
  * @param String $ErrorString
  * @param String $StatusString
  */
 public function getRandomPassword($ErrorString = "", $StatusString = "")
 {
     if (Controler_Main::getInstance()->getUserLevel() < BACKEND_USERLEVEL) {
         $ControlerStart = new Controler_Start();
         $ControlerStart->start();
         return false;
     }
     $Request = new Request();
     $UserFinder = new UserFinder();
     $UserOutput = $UserFinder->findById($Request->getAsInt("EditUserID"));
     $UserGroupFinder = new UserGroupFinder();
     $UserGroupCollection = $UserGroupFinder->findAll();
     $UGFinder = new UGFinder();
     $UGCollection = $UGFinder->findAll();
     $Template = Template::getInstance("tpl_BE_UserEdit.php");
     $Template->assign("EditUserID", $UserOutput->getID());
     $Template->assign("Name", $UserOutput->getName());
     $Template->assign("Email", $UserOutput->getEmail());
     $Template->assign("Pass", "");
     $Template->assign("UserGroupCollection", $UserGroupCollection);
     $Template->assign("UGCollection", $UGCollection);
     /* TODO: Salt für Passwort */
     $pass_word = "";
     $pool = "qwretzusapdfghkyxcvbnm";
     $pool .= "23456789";
     $pool .= "WRETZUPJKLHGSFDAYXCBVNM";
     srand((double) microtime() * 1000000);
     for ($index = 0; $index < RANDOM_PASSWORD_LENGTH; $index++) {
         $pass_word .= substr($pool, rand() % strlen($pool), 1);
     }
     $Template->assign("Password", $pass_word);
     $Template->assign("tb_PassConfirme", $pass_word);
     $Template->assign("ErrorString", $ErrorString);
     $Template->assign("StatusString", $StatusString);
     $Template->render();
 }
 /**
  * 
  * updateGroupUsers
  *
  * @param String $ErrorString
  * @param String $StatusString
  */
 public function updateGroupUsers($ErrorString = "", $StatusString = "")
 {
     if (Controler_Main::getInstance()->getUserLevel() < BACKEND_USERLEVEL) {
         $ControlerStart = new Controler_Start();
         $ControlerStart->start();
         return false;
     }
     $Request = new Request();
     $ErrorString = "";
     $StatusString = "";
     $UserGroupFinder = new UserGroupFinder();
     $Controler_Main = Controler_Main::getInstance();
     if (strlen($Request->getAsString("tb_UserGroupName")) < 3) {
         $ErrorString .= ":T_USER_GROUP_ERROR1:";
     }
     if (strlen($Request->getAsString("tb_UserGroupName"))) {
         $UserGroup = $UserGroupFinder->findByName($Request->getAsString("tb_UserGroupName"));
         if ($Group->getId() != 0) {
             $ErrorString .= ":T_USER_GROUP_ERROR2:";
         }
     }
     if (strlen($ErrorString) != 0) {
         $this->showEditGroup($ErrorString, $StatusString);
         return false;
     }
     $UserGroup = new UserGroup();
     $UserGroupManager = new UserGroupManager();
     $UserGroup = $Request->getAsString("tb_UserGroupName");
     $UserGroupID = $Request->getAsString("UserGroupID");
     $this->showEditUserGroup("", ":T_USER_GROUP_UPDATED_STATUS:");
 }