예제 #1
0
파일: index.php 프로젝트: jerryhanks/Melnet
 $view = htmlspecialchars($_GET["view"]);
 if ($view == "homeView") {
     go_homeforlogedin();
 } else {
     if ($view == "adminView") {
         //include_once 'adminmainpage.php';
         if (!$auth->isAdmin($_SESSION["user_id"])) {
             //direct user to the admin main page
             header("Location:../melnet/admin");
         } else {
             go_homeforlogedin();
         }
     } else {
         if ($view == "totalView") {
             //check if user has acces to total view
             if ($auth->isUser1($auth->selectSessionData($_SESSION["user_id"]))) {
                 //direct user to the total homepage
                 header("Location:../melnet/total");
             } else {
                 go_homeforlogedin();
             }
         } else {
             if ($view == "ubnkView") {
                 //ceck if user has acces to view uba
                 if ($auth->isUser1($auth->selectSessionData($_SESSION["user_id"]))) {
                     //direct user to the admin main page
                     header("Location:../melnet/ubnk");
                 } else {
                     go_homeforlogedin();
                     //add error notice
                 }