public function executeLogin(sfWebRequest $request) { if (helperFunctions::isLoggedIn($request)) { $this->redirect("siteadmin/index"); } if ($request->isMethod(sfRequest::POST) && $request->hasParameter('username') && $request->hasParameter('password')) { $username = $request->getParameter("username"); $password = $request->getParameter("password"); if (helperFunctions::isMaliciousString($username) || helperFunctions::isMaliciousString($password)) { $this->error = "* Malicious keywords detected. Do not attempt this again!"; } else { $conn = Propel::getConnection(); $admin = UserPeer::retrieveByPK($username, $conn); if (!is_object($admin) || $admin->getPassword() != $password) { $this->error = "* Incorrect credentials."; } elseif ($admin->getTypeId() != EnumItemPeer::USER_ADMIN) { $this->error = "* You do not have enough clearance to access this section."; } else { $this->getResponse()->setCookie('username', $username); // redirect to whatever page the user came from if ($request->hasParameter("redirect")) { $redirect = $request->getParameter("redirect"); } else { $redirect = "siteadmin/index"; } $this->redirect($redirect); } } } }
public function preExecute() { if (!helperFunctions::isLoggedIn(sfContext::getInstance()->getRequest())) { $this->redirect("siteadmin/login"); } $this->earliestYear = skuleadminConst::EARLIEST_YEAR; $this->date = getdate(); }
public function preExecute() { if (!helperFunctions::isLoggedIn(sfContext::getInstance()->getRequest())) { $this->redirect("siteadmin/login"); } // separator used for course_discipl assoc data $this->separator = "&&**&&"; }
public function preExecute() { if (!helperFunctions::isLoggedIn(sfContext::getInstance()->getRequest())) { $this->redirect("siteadmin/login"); } // separator used for course_discipl assoc data $this->separator = "&&**&&"; $this->date = getdate(); $this->earliestYear = skuleadminConst::EARLIEST_YEAR; }
public function preExecute() { if (!helperFunctions::isLoggedIn(sfContext::getInstance()->getRequest())) { $this->redirect("siteadmin/login"); } }
public function executeImportratings(sfWebRequest $request) { if (helperFunctions::isLoggedIn($request)) { $this->buildSubmenu(); $this->form = new skuleForm("frm", "maintenance/importratings", $request); } else { // redirect to log in page $this->buildSubmenu(); } }