예제 #1
0
 public function getLoginForm($aRow = null, $bReload = false)
 {
     if ($this->aLoginForm != null) {
         return $this->aLoginForm;
     }
     if (!empty($aRow["error"])) {
         FlexiPlatformHandler::getPlatformHandler()->addMessage($aRow["error"], "error");
     }
     $iSize = 25;
     $this->aLoginForm = $aForm = array("txtLogin" => array("#type" => "textfield", "#title" => flexiT("User-Id", "first"), "#weight" => 5, "#maxlength" => 100, "#required" => true, "#size" => $iSize, "#default_value" => ""), "txtPassword" => array("#type" => "password", "#title" => flexiT("Password", "first"), "#weight" => 7, "#maxlength" => 50, "#required" => true, "#size" => $iSize, "#default_value" => ""), "txtURL" => array("#type" => "hidden", "#default_value" => FlexiConfig::$sBaseURL), "bSubmit" => array("#type" => "submit", "#value" => flexiT("Login", "first"), "#weight" => 57));
     //fill in form value
     FlexiFormUtil::mergeFormWithData($aForm, $aRow);
     $aTheForm = array_merge($aForm, array("#type" => "form", "#upload" => false, "#method" => "post", "#action" => flexiURL("mod=FlexiLogin&method=login")));
     $aTheLoginForm = array("#type" => "div", "#title" => flexiUCFirstT("login form"), "form" => $aTheForm, "#attributes" => array("class" => "flexiphp_login_div"));
     //todo event for form before output
     $this->aLoginForm = $aTheLoginForm;
     return $this->aLoginForm;
 }
예제 #2
0
 public function methodVerify()
 {
     $iUserId = $this->getRequest("id");
     $sCode = $this->getRequest("r");
     $bVerify = FlexiPlatformHandler::getPlatformHandler()->verifyUser($iUserId, $sCode);
     $this->oView->addVar("verified", $bVerify);
     return true;
 }
예제 #3
0
 /**
  * Add msg to display
  * @param string message
  * @param string type: "info", "warn", "error"
  */
 public function addMessage($asMsg, $asType = "info")
 {
     FlexiPlatformHandler::getPlatformHandler()->addMessage($asMsg, $asType);
 }
예제 #4
0
 public function checkPermission($sTitle)
 {
     if (!$this->hasAccessToContent($sTitle)) {
         FlexiLogger::error(__METHOD__, "Permission denied: " . get_class($this) . ":" . $sTitle);
         FlexiController::getInstance()->redirectURL(FlexiConfig::$sBaseURL . "?" . FlexiConfig::getRequestModuleVarName() . "=FlexiLogin&" . FlexiConfig::getRequestMethodVarName() . "=denied");
     }
     FlexiPlatformHandler::getPlatformHandler()->forceDie();
 }