예제 #1
0
 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);
             }
         }
     }
 }
예제 #2
0
 public function preExecute()
 {
     if (!helperFunctions::isLoggedIn(sfContext::getInstance()->getRequest())) {
         $this->redirect("siteadmin/login");
     }
     $this->earliestYear = skuleadminConst::EARLIEST_YEAR;
     $this->date = getdate();
 }
예제 #3
0
 public function preExecute()
 {
     if (!helperFunctions::isLoggedIn(sfContext::getInstance()->getRequest())) {
         $this->redirect("siteadmin/login");
     }
     // separator used for course_discipl assoc data
     $this->separator = "&&**&&";
 }
예제 #4
0
 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;
 }
예제 #5
0
 public function preExecute()
 {
     if (!helperFunctions::isLoggedIn(sfContext::getInstance()->getRequest())) {
         $this->redirect("siteadmin/login");
     }
 }
예제 #6
0
 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();
     }
 }