Пример #1
0
 function index()
 {
     $this->load->model('User_Model', '', TRUE);
     $this->load->model('Usermodel', '', TRUE);
     $this->load->model('Userprofile', '', TRUE);
     if (isValidUser()) {
         $user = $this->User_Model->get_user_by_id(getUserProperty('id'));
     } else {
         redirect("", "location");
         return;
     }
     // Process form
     if (!empty($_POST)) {
         $profile_data = array('notifications' => $this->input->post('notifications'));
         $user_data = array('user_name' => $this->input->post('phone'));
         if (!empty($_POST['password'])) {
             $user_data['password'] = $this->freakauth_light->_encode($this->input->post('password'));
         }
         $this->Userprofile->updateUserProfile(getUserProperty('id'), $profile_data);
         $this->User_Model->update_user_by_id(getUserProperty('id'), $user_data);
         $this->db_session->set_flashdata('success', 'You have updated your account information');
         redirect('/profile');
     }
     $this->load->view('templates/header', $user);
     $this->load->view('user/profile', $user);
     $this->load->view('templates/footer');
 }
Пример #2
0
function displayMenu($config)
{
    //Menu Items
    echo '<h2>Main Menu</h2>';
    echo '<ul>';
    echo '<li><a href="' . $_SERVER['PHP_SELF'] . '" >Home</a></li>';
    echo '<li><a href="https://mail.mahoningcountyoh.gov" target="_blank">County E-Mail</a></li>';
    echo '<li><a href="https://mcso-training.mahoningsheriff.com" target="_blank">Sheriff Training</a></li>';
    echo '<li><a href="http://mcso-techsupport.mahoningcountyoh.gov/portal" target="_blank">Technical Support</a></li>';
    echo '<li><a href="http://connect.mahoningcountyoh.gov" target="_blank">Remote Support</a></li>';
    echo '<li><a href="https://aii.mahoningcountyoh.gov" target="_blank">Agency View Website</a></li>';
    echo '<li><a href="http://lodge141.com" target="_blank">Lodge141 Website</a></li>';
    echo '</ul>';
    if (isValidUser($config)) {
        echo '<h2>User Menu</h2>';
        echo '<ul>';
        echo '<li><a href="?updateProfile=true">Update Profile</a></li>';
        if ($_SESSION['isLDAP'] == false) {
            echo '<li><a href="?usermenu=true&ChangeBtn=true">Change Your Password</a><br /><br />';
        }
        echo '<li><a href="?secLog=true">Secondary Logs</a></li>';
        //if($config->adminLvl >= 25)
        echo '<li><a href="?radioLog=true">Inventory Checkout Logs</a></li>';
        //echo '<li><a href="?leave=true">Request Form</a></li>';
        echo '<li><a href="?isTimeRequestForm=true">Time Request Form</a></li>';
        echo '<li><a href="?myReq=true">My Submitted Requests</a></li>';
        echo '<li><a href="?myInv=true">My Inventory</a></li>';
    }
    echo '</ul>';
    displaySupv($config);
    displayAcct($config);
    displayAdmin($config);
}
Пример #3
0
function myAlerts($config)
{
    if (isValidUser($config)) {
        //popUpMessage('You have an Alert! <a href="?approve=true">Go To Request</a>');
    }
    alert_VerifyUsers($config);
    alert_PostPayrollValidation($config);
}
Пример #4
0
 function main($itsp)
 {
     include "dwoo/dwooAutoload.php";
     $valid = isValidUser();
     if ($valid) {
         $tpl = new Dwoo_Template_File('templates/newedittask.tpl');
         $this->dwoo = new Dwoo();
         $jsfiles = array();
         $jsfiles[] = array('jsfile' => 'js/newtask.js');
         $jsfiles[] = array('jsfile' => 'js/tiny_mce/jquery.tinymce.js');
         $jsfiles[] = array('jsfile' => 'js/tinymce.js');
         include_once "urls_backend.php";
         $urls = new urls_backend();
         $currenttask = $urls->getGP("__taskid");
         include_once "tasks_backend.php";
         $tasks = new tasks_backend();
         $submiturl = $_SERVER["HTTP_REFERER"];
         $parent = $tasks->getParent($currenttask);
         while ($parent["id"] > 0) {
             $params = array();
             $params["task"] = $parent["title"];
             $params["__taskid"] = $parent["id"];
             $breadcrumburl = $urls->newUrl("tasks", $params);
             $m_list[] = array('breadcrumburl' => '' . $breadcrumburl . '', 'breadcrumbitem' => '' . htmlentities($parent["title"]) . '', 'sepstart' => '&#187;&nbsp;');
             $parent = $tasks->getParent($parent["pid"]);
         }
         $params = array();
         $breadcrumburl = $urls->newUrl("tasks", $params);
         $m_list[] = array('breadcrumburl' => '' . $breadcrumburl . '', 'breadcrumbitem' => 'Main');
         $m_list = array_reverse($m_list);
         $markerArray = loggedInArray();
         $markerArray["tasktitle"] = $tasks->getTaskInfo($currenttask, "title", 1);
         $markerArray["taskdescription"] = $tasks->getTaskInfo($currenttask, "description", 1);
         $markerArray["js_list"] = $jsfiles;
         $markerArray["taskid"] = $currenttask;
         $markerArray["submiturl"] = $submiturl;
         $markerArray["func"] = "update";
         $progress = $tasks->getTaskInfo($currenttask, "progress");
         $markerArray["p" . $progress] = "selected";
         $markerArray["submitbtn"] = $itsp->bLang->getLL("page.tasks.updatetask");
         $markerArray["m_list"] = $m_list;
         $markerArray["headertitle"] = $tasks->getTaskInfo($currenttask, "title");
         $markerArray["selectedtask"] = $itsp->bLang->getLL("page.tasks.selectedtask");
         $markerArray["tasktitletxt"] = $itsp->bLang->getLL("page.tasks.tasktitle");
         $markerArray["taskdescriptiontxt"] = $itsp->bLang->getLL("page.tasks.description");
         $markerArray["taskprogress"] = $itsp->bLang->getLL("page.tasks.progress");
         $markerArray["tasknotstarted"] = $itsp->bLang->getLL("page.tasks.notstarted");
         $markerArray["taskfinished"] = $itsp->bLang->getLL("closed");
         $output = $this->dwoo->get($tpl, $markerArray);
         print $output;
     } else {
         print "access denied";
     }
 }
Пример #5
0
 function index()
 {
     log_message('error', 'test');
     if (isValidUser()) {
         $this->load->view('templates/header');
         $this->load->view('templates/welcome');
         $this->load->view('templates/footer');
     } else {
         redirect('', 'location');
     }
 }
Пример #6
0
 public function test()
 {
     $this->load->model('usermodel');
     $this->load->model('budget');
     if (isValidUser()) {
         $data['page'] = $this->load->view("dev/test", null, true);
         $this->load->view($this->container, $data);
     } else {
         $this->unAuthorizeduser();
     }
 }
Пример #7
0
 function main($itsp)
 {
     $itsp->bLang->setLanguage($_GET["lang"]);
     $valid = isValidUser();
     if ($valid) {
         logoutUser();
         include_once "urls_backend.php";
         $urls = new urls_backend();
         $params = array();
         $logouturl = $urls->newUrl("frontpage", $params);
         print '<META HTTP-EQUIV="Refresh" Content = "0;URL=' . config::basehref . '">';
     } else {
         print "access denied";
     }
 }
Пример #8
0
 function login()
 {
     if (isValidUser() == false) {
         $this->data['title'] = "Login";
         //validate form input
         $this->form_validation->set_rules('username', 'Username', 'required');
         $this->form_validation->set_rules('password', 'Password', 'required');
         if ($this->form_validation->run() == true) {
             //check to see if the user is logging in
             //check for "remember me"
             $remember = (bool) $this->input->post('remember');
             if ($this->ion_auth->login($this->input->post('username'), $this->input->post('password'), $remember)) {
                 //if the login is successful
                 //redirect them back to the home page
                 $this->session->set_flashdata('message', $this->ion_auth->messages());
                 redirect(base_url(), 'refresh');
             } else {
                 //if the login was un-successful
                 //redirect them back to the login page
                 $this->session->set_flashdata('message', $this->ion_auth->errors());
                 redirect(base_url() . 'auth/login', 'refresh');
                 //use redirects instead of loading views for compatibility with MY_Controller libraries
             }
         } else {
             //the user is not logging in so display the login page
             //set the flash data error message if there is one
             $this->data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message');
             /*
             			$this->data['identity'] = array('name' => 'identity',
             				'id' => 'identity',
             				'type' => 'text',
             				'value' => $this->form_validation->set_value('username'),
             			);
             			$this->data['password'] = array('name' => 'password',
             				'id' => 'password',
             				'type' => 'password',
             			);
             			$this->_render_page('auth/login', $this->data);
             * 
             */
             $data['page'] = $this->load->view('login', $this->data, true);
             $this->load->view($this->container, $data);
         }
     } else {
         redirect(base_url(), 'location');
     }
 }
Пример #9
0
 function index()
 {
     $this->load->model('User_Model', '', TRUE);
     $this->load->model('Plan_Model', '', TRUE);
     $this->load->model('Gram_Model', '', TRUE);
     $this->load->model('Message_Model', '', TRUE);
     if (isValidUser()) {
         $user = $this->User_Model->get_user_by_id(getUserProperty('id'));
     } else {
         redirect("", "location");
         return;
     }
     $messages = $this->Message_Model->get_messages_by_user_id($user["user_id"]);
     $this->load->view('templates/header', array("user" => $user));
     $this->load->view('dashboard/stats', array("messages" => $messages));
     $this->load->view('templates/footer');
 }
Пример #10
0
 function main($itsp)
 {
     $itsp->bLang->setLanguage($_GET["lang"]);
     include_once "dwoo/dwooAutoload.php";
     $valid = isValidUser();
     if ($valid) {
         $tpl = new Dwoo_Template_File('templates/home.tpl');
         $dwoo = new Dwoo();
         $markerArray = loggedInArray();
         $output = $dwoo->get($tpl, $markerArray);
         print $output;
     } else {
         $tpl = new Dwoo_Template_File('templates/frontpage.tpl');
         $dwoo = new Dwoo();
         $markerArray = templateArray();
         $markerArray["loginerror"] = "Failed to login";
         $output = $dwoo->get($tpl, $markerArray);
         print $output;
     }
 }
Пример #11
0
 function main($itsp)
 {
     include "dwoo/dwooAutoload.php";
     if ($itsp->bUrl->getGP("s")) {
         user_backend::verifyUser($itsp->bUrl->getGP("s"), $itsp->bUrl->getGP("u"), 1);
     }
     $valid = isValidUser();
     if ($valid) {
         $tpl = new Dwoo_Template_File('templates/verifieduser.tpl');
         $dwoo = new Dwoo();
         $params = array();
         $homeurl = "/" . config::installpath . "" . $itsp->bUrl->newUrl("tasks", $params);
         $markerArray = loggedInArray();
         $markerArray["pageVerifiedUserAccepted"] = $itsp->bLang->getLL("page.verifieduser.useraccepted");
         $markerArray["pageVerifiedUserHomeUrl"] = $itsp->bLang->getLL("page.verifieduser.homeurl");
         $markerArray["homeUrl"] = $homeurl;
         $output = $dwoo->get($tpl, $markerArray);
         print $output;
     } else {
         print "access denied";
     }
 }
Пример #12
0
 function index()
 {
     $this->load->model('User_Model', '', TRUE);
     $this->load->model('Plan_Model', '', TRUE);
     $this->load->model('Gram_Model', '', TRUE);
     if (!isValidUser()) {
         $data['fal'] = $this->fal_front->register();
         $this->load->view('templates/header');
         $this->load->view('templates/home', $data);
     } else {
         $first_use = false;
         $user = $this->User_Model->get_user_by_id(getUserProperty('id'));
         if ($user["welcome_message_seen"] == 0) {
             $first_use = true;
         }
         $this->load->view('templates/header', array("user" => $user));
         $plan = $this->Plan_Model->get_plan_by_user_id(getUserProperty('id'));
         //echo "<pre>Plan: ".print_r($plan, true)."</pre>\n";
         $grams = $this->Gram_Model->get_grams_by_plan_id($plan["plan_id"]);
         //echo "<pre>Grams: ".print_r($grams, true)."</pre>\n";
         $this->load->view('dashboard/main', array("grams" => $grams, "first_use" => $first_use));
     }
     $this->load->view('templates/footer');
 }
Пример #13
0
function displayUsers()
{
    /*
     * Shows all users and gives the option to edit any fields
     */
    $admin = $_SESSION['admin'];
    if ($admin >= 50 && isValidUser()) {
        $mysqli = connectToSQL();
        $myq = "SELECT *\r\n                FROM EMPLOYEE";
        $result = $mysqli->query($myq);
        if (!$result) {
            throw new Exception("Database Error [{$mysqli->errno}] {$mysqli->error}");
        }
        //build table
        resultTable($mysqli, $result);
        //write any updates to DB when Save is pressed
        if (isset($_POST['saveBtn'])) {
            //saveBtn created in resultTable()
            $result = $mysqli->query($myq);
            $i = 0;
            $fieldNameArray = array();
            $values = array();
            while ($finfo = mysqli_fetch_field($result)) {
                $tableName = $finfo->orgtable;
                $fieldNameArray[$i] = $finfo->orgname;
                $values["{$fieldNameArray[$i]}"] = $fieldNameArray[$i] . "=" . "'" . $mysqli->real_escape_string($_POST["{$fieldNameArray[$i]}"]) . "'";
                $i++;
            }
            //turn the array into comma seperated values
            $csvValues = implode(',', $values);
            $updateQuery = "UPDATE " . $tableName . " SET " . $csvValues . " \r\n            WHERE " . $values['ID'];
            echo "<br>" . $updateQuery;
            $updateResult = $mysqli->query($updateQuery);
            if (!$updateResult) {
                throw new Exception("Database Error [{$mysqli->errno}] {$mysqli->error}");
            }
        }
    }
}
function displayRequestLookup($config)
{
    $totalRows = isset($_POST['totalRows']) ? $_POST['totalRows'] : '';
    $foundUserFNAME = '';
    $foundUserLNAME = '';
    $foundUserName = '';
    $foundUserID = '';
    if ($totalRows > 0) {
        //get post info providied from search results
        for ($i = 1; $i <= $totalRows; $i++) {
            if (isset($_POST['foundUser' . $i])) {
                $foundUserFNAME = $_POST['foundUserFNAME' . $i];
                $foundUserLNAME = $_POST['foundUserLNAME' . $i];
                $foundUserName = $_POST['foundUserName' . $i];
                $foundUserID = $_POST['foundUserID' . $i];
                if (isset($_POST['isReserve' . $i])) {
                    echo '<input type="hidden" name="isReserve" value="true" />';
                }
                break;
            }
            //end if
        }
        //end for
    }
    if (isValidUser($config) && (isset($_POST['lname']) || isset($_POST['editBtn']))) {
        if (isset($_POST['lname'])) {
            $lname = $_SESSION['lname'] = strtoupper($_POST['lname']);
            $startDate = $_SESSION['start'] = new DateTime($_POST['start']);
            $endDate = $_SESSION['end'] = new DateTime($_POST['end']);
        } else {
            $lname = $_SESSION['lname'];
            $startDate = $_SESSION['start'];
            $endDate = $_SESSION['end'];
        }
        $mysqli = $config->mysqli;
        //query for all time requests if no date selected
        if (!empty($_POST['start']) && !empty($_POST['end'])) {
            $myq = "SELECT DISTINCT REFER 'RefNo', CONCAT_WS(', ', REQ.LNAME, REQ.FNAME) 'Employee', DATE_FORMAT(REQDATE,'%a %b %d %Y') 'Requested',\r\n                            DATE_FORMAT(USEDATE,'%a %b %d %Y') 'Used', BEGTIME 'Start',\r\n                            ENDTIME 'End', HOURS 'Hrs',\r\n                            T.DESCR 'Type', SUBTYPE 'Subtype', CALLOFF 'Calloff', NOTE 'Comment', STATUS 'Status', \r\n                            APR.LNAME 'ApprovedBy', REASON 'Reason' \r\n                        FROM REQUEST R\r\n                        INNER JOIN TIMETYPE AS T ON R.TIMETYPEID=T.TIMETYPEID\r\n                        LEFT JOIN EMPLOYEE AS REQ ON REQ.IDNUM=R.IDNUM\r\n                        LEFT JOIN EMPLOYEE AS APR ON APR.IDNUM=R.APPROVEDBY\r\n                        WHERE USEDATE BETWEEN '" . $config->mysqli->real_escape_string($startDate->format('Y-m-d')) . "' \r\n                            AND '" . $config->mysqli->real_escape_string($endDate->format('Y-m-d')) . "' \r\n                        AND REQ.LNAME LIKE '%" . $config->mysqli->real_escape_string($lname) . "%'";
        } else {
            $myq = "SELECT DISTINCT REFER 'RefNo', CONCAT_WS(', ', REQ.LNAME, REQ.FNAME) 'Employee', DATE_FORMAT(REQDATE,'%a %b %d %Y') 'Requested',\r\n                            DATE_FORMAT(USEDATE,'%a %b %d %Y') 'Used', BEGTIME 'Start',\r\n                            ENDTIME 'End', HOURS 'Hrs',\r\n                            T.DESCR 'Type', SUBTYPE 'Subtype', CALLOFF 'Calloff', NOTE 'Comment', STATUS 'Status', \r\n                            APR.LNAME 'ApprovedBy', REASON 'Reason' \r\n                        FROM REQUEST R\r\n                        INNER JOIN TIMETYPE AS T ON R.TIMETYPEID=T.TIMETYPEID\r\n                        LEFT JOIN EMPLOYEE AS REQ ON REQ.IDNUM=R.IDNUM\r\n                        LEFT JOIN EMPLOYEE AS APR ON APR.IDNUM=R.APPROVEDBY                  \r\n                        WHERE REQ.LNAME LIKE '%" . $config->mysqli->real_escape_string($lname) . "%'";
        }
        //popUpMessage($myq); //DEBUG
        $result = $mysqli->query($myq);
        SQLerrorCatch($mysqli, $result);
        resultTable($mysqli, $result);
        echo "<a href='" . $_SERVER['REQUEST_URI'] . "'>Back to Search</a>";
    } else {
        ?>
        <form name="lookup" method="post" action="<?php 
        echo $_SERVER['REQUEST_URI'];
        ?>
">
            <input type="hidden" name="formName" value="lookup" />
            <input type="hidden" name="searchReserves" value="false" />
        <h1>Lookup Requests by Employee</h1>
        
        <p>Search by last name:
            
            <input type="text" name="lname" value="<?php 
        echo $foundUserLNAME;
        ?>
" /> or <?php 
        displayUserLookup($config);
        ?>
</p>
        <p>Date range: From <?php 
        displayDateSelect('start', 'date_1');
        ?>
            to <?php 
        displayDateSelect('end', 'date_2');
        ?>
</p>
        <p>(Leave date range blank to show requests for all time.)</p>
        
        <p><input type="submit" name="Submit" value="Search"></p>
        </form>
        <?php 
    }
}
Пример #15
0
 function main($itsp)
 {
     include "dwoo/dwooAutoload.php";
     $valid = isValidUser();
     if ($valid) {
         include_once "urls_backend.php";
         $urls = new urls_backend();
         include_once "tasks_backend.php";
         $tasks = new tasks_backend();
         $this_url = "http://" . $_SERVER["SERVER_NAME"] . "" . $_SERVER["REQUEST_URI"];
         if ($_POST["func"] == "create") {
             $_pid = $urls->getGP("__taskid");
             $_title = $_POST["tasktitle"];
             $_description = $_POST["taskdescription"];
             $tasks->createNewTask($_pid, $_title, $_description);
             header("Location: {$this_url}#", TRUE, 302);
             exit;
         }
         if ($_POST["func"] == "update" && !isset($_POST["delete"])) {
             $_id = $_POST["taskid"];
             $_title = $_POST["tasktitle"];
             $_description = $_POST["taskdescription"];
             $tasks->updateTask($_id, $_title, $_description);
             $tasks->setField($_id, "progress", $_POST["taskprogress"]);
             header("Location: {$this_url}#", TRUE, 302);
             exit;
         }
         if (isset($_POST["delete"])) {
             $_id = $_POST["taskid"];
             $tasks->setField($_id, "deleted", 1);
             header("Location: {$this_url}#", TRUE, 302);
             exit;
         }
         $tpl = new Dwoo_Template_File('templates/tasks.tpl');
         $this->dwoo = new Dwoo();
         $currenttask = $urls->getGP("__taskid");
         $currenttitle = $urls->getGP("task");
         $jsfiles = array();
         $jsfiles[] = array('jsfile' => 'js/jquery-ui-1.8.4.custom.min.js');
         $jsfiles[] = array('jsfile' => 'js/tasklist.php?t=' . $currenttask);
         $jsfiles[] = array('jsfile' => 'js/widgetTreeList.js');
         $tasklist = $this->getSubTasks(0, 0);
         $markerArray = array();
         $markerArray["ulid"] = "";
         $markerArray["ulclass"] = "newul";
         $markerArray = loggedInArray();
         $markerArray["js_list"] = $jsfiles;
         $_tasks = $this->getSubTasks($currenttask ? $currenttask : 0, 0, 99);
         $_closedtasks = $this->getSubTasks($currenttask ? $currenttask : 0, 0, 100, "=");
         $m_list = array();
         $getParent = 1;
         $parent = $tasks->getParent($currenttask);
         while ($parent["id"] > 0) {
             $params = array();
             $params["task"] = $parent["title"];
             $params["__taskid"] = $parent["id"];
             $breadcrumburl = $urls->newUrl("tasks", $params);
             $m_list[] = array('breadcrumburl' => '' . $breadcrumburl . '', 'breadcrumbitem' => '' . $parent["title"] . '', 'sepstart' => '&#187;&nbsp;');
             $parent = $tasks->getParent($parent["pid"]);
         }
         $params = array();
         $breadcrumburl = $urls->newUrl("tasks", $params);
         $m_list[] = array('breadcrumburl' => '' . $breadcrumburl . '', 'breadcrumbitem' => 'Main');
         $m_list = array_reverse($m_list);
         $p_list = array();
         $openmsg = $itsp->bLang->getLL("open");
         $closedmsg = $itsp->bLang->getLL("closed");
         $toggleinfomsg = $itsp->bLang->getLL("page.tasks.toggleinfo");
         $movethismsg = $itsp->bLang->getLL("page.tasks.movethis");
         $dontmovethismsg = stripslashes($itsp->bLang->getLL("page.tasks.dontmovethis"));
         $user = new user_backend();
         $moveableTasks = unserialize($user->getUserSetting("movingTasks"));
         $moveherevisible = "show";
         if ($moveableTasks == "") {
             $moveherevisible = "hide";
         }
         if (count($moveableTasks) < 1) {
             $moveherevisible = "hide";
         }
         foreach ($_tasks as $key => $value) {
             $params = array();
             $params["task"] = $currenttitle . "/" . $value["title"];
             $params["__taskid"] = $value["id"];
             $taskurl = $urls->newUrl("tasks", $params);
             $edittaskurl = $urls->newUrl("edittask", $params);
             $subtasks = $tasks->getNumberOfSubTasks($value["id"]);
             $opensubtasks = $tasks->getNumberOfSubTasks($value["id"], 100);
             $status = $tasks->getTaskInfo($value["id"], "progress");
             if ($status < 100) {
                 $status = $openmsg;
             } else {
                 $status = $closedmsg;
             }
             $created = $tasks->getTaskInfo($value["id"], "crdate");
             if ($created > 0) {
                 $created = date("d.m.Y", $created);
             } else {
                 $created = "N/A";
             }
             $toggleonoff = "strike nolink";
             if ($value["description"] != "") {
                 $toggleonoff = "";
             }
             $p_list[] = array('liid' => "liid_" . $value["id"], 'liclass' => 'taskframe', 'licontent' => '' . $value["title"], 'taskurl' => '' . $taskurl . '', 'edittaskurl' => '' . $edittaskurl . '', 'subtasks' => '' . $subtasks . '', 'opensubtasks' => '' . $opensubtasks . '', 'toggleinfomsg' => '' . $toggleinfomsg . '', 'moveablemsg' => $moveableTasks[$value["id"]] ? $dontmovethismsg : $movethismsg, 'toggleonoff' => '' . $toggleonoff . '', 'created' => '' . $created . '', 'status' => '' . $status . '', 'statustxt' => $itsp->bLang->getLL("page.tasks.statustxt"), 'createdtxt' => $itsp->bLang->getLL("page.tasks.createdtxt"), 'opensubtaskstxt' => $itsp->bLang->getLL("page.tasks.opensubtaskstxt"), 'subtaskstxt' => $itsp->bLang->getLL("page.tasks.subtasks"), 'edittask' => $itsp->bLang->getLL("page.tasks.edittask"), 'state' => 'open', 'id' => $value["id"], 'taskdescription' => '' . $value["description"] . '');
         }
         foreach ($_closedtasks as $key => $value) {
             $params = array();
             $params["task"] = $currenttitle . "/" . $value["title"];
             $params["__taskid"] = $value["id"];
             $taskurl = $urls->newUrl("tasks", $params);
             $edittaskurl = $urls->newUrl("edittask", $params);
             $subtasks = $tasks->getNumberOfSubTasks($value["id"]);
             $opensubtasks = $tasks->getNumberOfSubTasks($value["id"], 100);
             $status = $tasks->getTaskInfo($value["id"], "progress");
             if ($status < 100) {
                 $status = $openmsg;
             } else {
                 $status = $closedmsg;
             }
             $created = $tasks->getTaskInfo($value["id"], "crdate");
             if ($created > 0) {
                 $created = date("d.m.Y", $created);
             } else {
                 $created = "N/A";
             }
             $p_list[] = array('liid' => "liid_" . $value["id"], 'liclass' => 'taskframe', 'licontent' => '' . $value["title"], 'taskurl' => '' . $taskurl . '', 'edittaskurl' => '' . $edittaskurl . '', 'subtasks' => '' . $subtasks . '', 'opensubtasks' => '' . $opensubtasks . '', 'created' => '' . $created . '', 'status' => '' . $status . '', 'state' => 'closed', 'toggleinfomsg' => '' . $toggleinfomsg . '', 'moveablemsg' => $moveableTasks[$value["id"]] ? $dontmovethismsg : $movethismsg, 'statustxt' => $itsp->bLang->getLL("page.tasks.statustxt"), 'createdtxt' => $itsp->bLang->getLL("page.tasks.createdtxt"), 'opensubtaskstxt' => $itsp->bLang->getLL("page.tasks.opensubtaskstxt"), 'subtaskstxt' => $itsp->bLang->getLL("page.tasks.subtasks"), 'edittask' => $itsp->bLang->getLL("page.tasks.edittask"), 'id' => $value["id"], 'taskdescription' => '' . $value["description"] . '');
         }
         $p_list[] = array('liid' => "liid_newtask", 'liclass' => 'liid_newtask', 'licontent' => '', 'taskurl' => '', 'taskdescription' => '');
         $markerArray["p_list"] = $p_list;
         $markerArray["m_list"] = $m_list;
         $thistask = $urls->getGP("__taskid");
         $params = array();
         $params["task"] = $currenttitle;
         $params["__taskid"] = $currenttask;
         $newtask = $urls->newUrl("newtask", $params);
         $checkedall = "";
         $showclosed = "";
         if ($user->getUserSetting("showAllField") == "on") {
             $checkedall = " checked=checked ";
         }
         if ($user->getUserSetting("showClosedTasks") == "on") {
             $showclosed = " checked=checked ";
         }
         if ($user->getUserSetting("showCompactMode") == "on") {
             $showcompact = " checked=checked ";
         }
         $_title = $tasks->getTaskInfo($thistask, "title");
         $markerArray["taskdescription"] = $tasks->getTaskInfo($thistask, "description");
         $markerArray["taskname"] = $_title;
         $markerArray["headertitle"] = $_title ? $_title : $itsp->bLang->getLL("page.tasks.maintitle");
         $markerArray["newtaskurl"] = $newtask;
         $markerArray["showallinfochecked"] = $checkedall;
         $markerArray["showclosedchecked"] = $showclosed;
         $markerArray["showcompactmodechecked"] = $showcompact;
         $markerArray["movetaskshere"] = $itsp->bLang->getLL("page.tasks.movetaskshere_1") . " <span class=\"movecount\">" . count($moveableTasks) . "</span>" . $itsp->bLang->getLL("page.tasks.movetaskshere_2");
         $markerArray["moveherevisible"] = $moveherevisible;
         $markerArray["selectedtask"] = $itsp->bLang->getLL("page.tasks.selectedtask");
         $markerArray["task"] = $itsp->bLang->getLL("page.tasks.task");
         $markerArray["description"] = $itsp->bLang->getLL("page.tasks.description");
         $markerArray["subtasks"] = $itsp->bLang->getLL("page.tasks.subtasks");
         $markerArray["showallinfo"] = $itsp->bLang->getLL("page.tasks.options.showallinfo");
         $markerArray["showclosedtasks"] = $itsp->bLang->getLL("page.tasks.options.showclosedtasks");
         $markerArray["showcompactmode"] = $itsp->bLang->getLL("page.tasks.options.compactmode");
         $markerArray["options"] = $itsp->bLang->getLL("page.tasks.options");
         $markerArray["newtask"] = $itsp->bLang->getLL("page.tasks.newtask");
         $settings = $this->dwoo->get($tpl, $markerArray);
         print $settings;
     } else {
         print "access denied";
     }
 }
Пример #16
0
 function main($itsp)
 {
     $itsp->bLang->setLanguage($_GET["lang"]);
     include "dwoo/dwooAutoload.php";
     $displayNewUserForm = 1;
     $errormsg = "";
     if ($_POST["username"] && $_POST["password"]) {
         include_once "user_backend.php";
         $bUser = new user_backend("newuser");
         try {
             $errormsg = "";
             $errors = 0;
             $passwordok = 0;
             if ($_POST["username"]) {
                 include_once "user_backend.php";
                 if (!$bUser->isUsernameAvail($_POST["username"])) {
                     if ($errormsg != "") {
                         $errormsg .= "<br />";
                     }
                     $errormsg .= $itsp->bLang->getLL("page.myinfo.usernamenotavailable");
                     $errors++;
                 }
             }
             if ($_POST["password"] != $_POST["repeatpassword"]) {
                 if ($errormsg != "") {
                     $errormsg .= "<br />";
                 }
                 $errormsg .= $itsp->bLang->getLL("page.myinfo.notidenticalpasswords");
                 $errors++;
             } else {
                 if ($_POST["password"] != "itsplanned") {
                     $passwordok = 1;
                 }
             }
             if (!preg_match('/^[^@]+@[a-zA-Z0-9._-]+\\.[a-zA-Z]+$/', $_POST["email"])) {
                 if ($errormsg != "") {
                     $errormsg .= "<br />";
                 }
                 $errormsg .= $itsp->bLang->getLL("page.myinfo.novalidemail");
                 $errors++;
             }
             if ($errors == 0) {
                 $bUser->createNew($_POST["username"], $_POST["password"]);
                 isValidUser("create");
                 $bUser->setUserInfo("realname", $_POST["realname"]);
                 $bUser->setUserInfo("email", $_POST["email"]);
                 $bUser->setUserInfo("verified", '0');
                 $tpl = new Dwoo_Template_File('templates/newuseremail.tpl');
                 $dwoo = new Dwoo();
                 $params = array();
                 $params["s"] = session_id();
                 $params["u"] = $_POST["username"];
                 $verifyuserUrl = $itsp->bUrl->newUrl("verifyuser", $params, 1);
                 $rejectuserUrl = $itsp->bUrl->newUrl("rejectuser", $params, 1);
                 $markerArray = array();
                 $markerArray["emailNewuserHello"] = $itsp->bLang->getLL("email.newuser.hello");
                 $markerArray["username"] = $_POST["username"];
                 $markerArray["emailNewuserHostname"] = config::hostname;
                 $markerArray["emailNewuserMsg1"] = $itsp->bLang->getLL("email.newuser.msg1");
                 $markerArray["emailNewuserMsg2"] = $itsp->bLang->getLL("email.newuser.msg2");
                 $markerArray["emailNewuserMsg3"] = $itsp->bLang->getLL("email.newuser.msg3");
                 $markerArray["emailNewuserMsg4"] = $itsp->bLang->getLL("email.newuser.msg4");
                 $markerArray["emailNewuserMsg5"] = $itsp->bLang->getLL("email.newuser.msg5");
                 $markerArray["emailNewuserMsg6"] = $itsp->bLang->getLL("email.newuser.msg6");
                 $markerArray["emailNewuserVerifyURL"] = $verifyuserUrl;
                 $markerArray["emailNewuserRejectURL"] = $rejectuserUrl;
                 $markerArray["emailNewuserSignature"] = $itsp->bLang->getLL("email.newuser.signature");
                 $newuseremail = $dwoo->get($tpl, $markerArray);
                 $emailto = $_POST["email"];
                 $emailsubject = $itsp->bLang->getLL("email.newuser.subject");
                 $emailheaders = "From: " . config::newuserFromEmail . "\r\n";
                 mail($emailto, $emailsubject, $newuseremail, $emailheaders);
                 $tpl = new Dwoo_Template_File('templates/userverification.tpl');
                 $dwoo = new Dwoo();
                 $markerArray = templateArray();
                 $markerArray["pageUserverificationMsg1"] = $itsp->bLang->getLL("page.userverification.msg1");
                 $output = $dwoo->get($tpl, $markerArray);
                 print $output;
                 exit;
             }
         } catch (Exception $e) {
             if ($e->getMessage() == "UserExist") {
                 $errormsg = "Username is already taken";
             }
         }
     }
     if ($displayNewUserForm) {
         $tpl = new Dwoo_Template_File('templates/myinfonew.tpl');
         $dwoo = new Dwoo();
         $markerArray = templateArray();
         $markerArray["url"] = $_SERVER["REQUEST_URI"];
         $markerArray["pageMyinfoErrorMsg"] = $errormsg;
         $markerArray["username"] = $itsp->bLang->getLL("username");
         $markerArray["password"] = $itsp->bLang->getLL("password");
         $markerArray["pageMyinfoUsername"] = $itsp->bLang->getLL("page.myinfo.username");
         $markerArray["pageMyinfoNewPassword"] = $itsp->bLang->getLL("page.myinfo.newpassword");
         $markerArray["pageMyinfoNewPasswordRepeat"] = $itsp->bLang->getLL("page.myinfo.newpasswordrepeat");
         $markerArray["pageMyinfoRealname"] = $itsp->bLang->getLL("page.myinfo.realname");
         $markerArray["pageMyinfoEmail"] = $itsp->bLang->getLL("page.myinfo.email");
         $markerArray["pageMyinfoUpdate"] = $itsp->bLang->getLL("page.myinfo.create");
         $markerArray["pageMyinfoLayoutLanguage"] = $itsp->bLang->getLL("page.myinfo.layoutlanguage");
         $markerArray["usernamefield"] = $_POST["username"];
         $markerArray["email"] = $_POST["email"];
         $markerArray["realname"] = $_POST["realname"];
         $markerArray["headertitle"] = $itsp->bLang->getLL("page.myinfo.newusertitle");
         $markerArray["loginbtn"] = $itsp->bLang->getLL("login");
         $createnewuser = $dwoo->get($tpl, $markerArray);
         print $createnewuser;
     }
 }
Пример #17
0
function validateUser()
{
    if (isValidUser()) {
        logVerify(getCookie('ID'), "OK");
        changeCookie();
    } else {
        logVerify(getCookie('ID'), "INVALID");
        header("Location: logout.php");
    }
}
Пример #18
0
function displayLogin($config)
{
    if (!isValidUser($config)) {
        $error = '0';
        $noPass = false;
        $noUser = false;
        $username = isset($_POST['username']) ? $_POST['username'] : '';
        $password = isset($_POST['password']) ? $_POST['password'] : '';
        if (isset($_POST['submitBtn'])) {
            $domain = isset($_POST['domainOPT']) ? $_POST['domainOPT'] : 'SHERIFF';
            if (empty($username)) {
                $noUser = true;
            }
            if (empty($password)) {
                $noPass = true;
            }
            // Try to login the user
            if ($noUser && $noPass) {
                $error = 'Please Provide a Username and Password';
            } else {
                //$error = loginUser($username,$password);
                $error = loginLDAPUser($username, $password, $config, $domain);
            }
        }
        if ($error != '') {
            //First time seeing this screen or Invalid User Input
            ?>
            <div class="thumbnail"><img src="style/icon4.gif" alt="" /></div>
            <h3><?php 
            echo $config->getTitle();
            ?>
</h3>
            <form action="<?php 
            echo $_SERVER['PHP_SELF'];
            ?>
" method="post" name="loginform">
                <table width="50%">
                <tr><td>Username:</td><td> <input class="text" name="username" type="text" 
                                        <?php 
            echo "value='" . $username . "'";
            if ($noUser) {
                echo "style='background:#FFFFFF;border:1px solid #FF0000'";
            }
            ?>
 /></td></tr>
                <tr><td>Password:</td><td> <input class="text" name="password" type="password" 
                                        <?php 
            if (isset($_POST['submitBtn'])) {
                echo "style=\"background:#FFFFFF;border:1px solid #FF0000;\"";
            }
            ?>
/></td></tr>
                <tr><td>Domain:</td><td> 
                        <select name="domainOPT">
                            <option value="MAHONINGCO">MAHONING COUNTY</option>
                        </select> 
                                        </td></tr>
                <tr><td>&nbsp</td><td>&nbsp</td></tr>
                <tr><td></td><td align="center"><input style="font-size: 20px;" class="text" type="submit" name="submitBtn" value="Login" /></td></tr>
                </table>
                <div class="post_footer">
                    <div align="center"></div>
                </div>
            </form>
            <?php 
            //User had input but had an error.  Display the error
            if (isset($_POST['submitBtn'])) {
                ?>
                <div class="thumbnail"><img src="/style/icon2.gif" alt="" /></div>  
                <h3>Error Message:</h3>
                <p><?php 
                echo $error;
                ?>
</p>
            <?php 
            }
        }
    } else {
        displayLogout();
    }
}
Пример #19
0
echo $base_url;
?>
sessions/logout" class="CronosProBold">Log out</a><br />
  		  Notifications: <a href="<?php 
echo $base_url;
?>
profile"><? echo ($user["notifications"] == 1 ? "on" : "off"); ?></a>
	    <? } ?>
	  </div>
	</div>
	<!-- HEADER, LOGIN, and REGISTRATION -->

	<!-- NAVIGATION -->
	<div id="nav">
	  <ul class="CronosProBold wrapper">
      <? if (!isValidUser()) { ?>
	    <li><a href="<?php 
echo $base_url;
?>
">Home</a></li>
	    <li><a href="<?php 
echo $base_url;
?>
features">Features</a></li>
	    <li><a href="<?php 
echo $base_url;
?>
about">About</a></li>
	    <li><a href="<?php 
echo $base_url;
?>
Пример #20
0
 function main($itsp)
 {
     include_once "dwoo/dwooAutoload.php";
     $valid = isValidUser();
     if ($valid) {
         include_once "user_backend.php";
         $userb = new user_backend();
         if ($_POST) {
             $errormsg = "";
             $errors = 0;
             $passwordok = 0;
             if ($_POST["username"]) {
                 include_once "user_backend.php";
                 $userb = new user_backend();
                 if (!$userb->isUsernameAvail($_POST["username"])) {
                     if ($errormsg != "") {
                         $errormsg .= "<br />";
                     }
                     $errormsg .= $itsp->bLang->getLL("page.myinfo.usernamenotavailable");
                     $errors++;
                 }
             }
             if ($_POST["password"] != $_POST["repeatpassword"]) {
                 if ($errormsg != "") {
                     $errormsg .= "<br />";
                 }
                 $errormsg .= $itsp->bLang->getLL("page.myinfo.notidenticalpasswords");
                 $errors++;
             } else {
                 if ($_POST["password"] != "itsplanned") {
                     $passwordok = 1;
                 }
             }
             if (!preg_match('/^[^@]+@[a-zA-Z0-9._-]+\\.[a-zA-Z]+$/', $_POST["email"])) {
                 if ($errormsg != "") {
                     $errormsg .= "<br />";
                 }
                 $errormsg .= $itsp->bLang->getLL("page.myinfo.novalidemail");
                 $errors++;
             }
             if ($errors == 0) {
                 $userb->setUserInfo("realname", $_POST["realname"]);
                 $userb->setUserInfo("username", $_POST["username"]);
                 $userb->setUserInfo("email", $_POST["email"]);
                 if ($passwordok) {
                     $userb->setUserInfo("password", md5($_POST["password"]));
                 }
                 $userb->setUserSetting("layoutlanguage", $_POST["language"]);
                 $itsp->bLang->setLanguage($_POST["language"]);
             }
         }
         $tpl = new Dwoo_Template_File('templates/myinfo.tpl');
         $dwoo = new Dwoo();
         $language = $userb->getUserSetting("layoutlanguage");
         $markerArray = loggedInArray();
         $markerArray["pageMyinfoUsername"] = $itsp->bLang->getLL("page.myinfo.username");
         $markerArray["pageMyinfoNewPassword"] = $itsp->bLang->getLL("page.myinfo.newpassword");
         $markerArray["pageMyinfoNewPasswordRepeat"] = $itsp->bLang->getLL("page.myinfo.newpasswordrepeat");
         $markerArray["pageMyinfoRealname"] = $itsp->bLang->getLL("page.myinfo.realname");
         $markerArray["pageMyinfoEmail"] = $itsp->bLang->getLL("page.myinfo.email");
         $markerArray["pageMyinfoUpdate"] = $itsp->bLang->getLL("page.myinfo.update");
         $markerArray["pageMyinfoLayoutLanguage"] = $itsp->bLang->getLL("page.myinfo.layoutlanguage");
         $markerArray["pageMyinfoErrorMsg"] = $errormsg;
         $markerArray["password"] = "******";
         $markerArray["email"] = $userb->getUserInfo("email");
         $markerArray["realname"] = $userb->getUserInfo("realname");
         $markerArray["languageset" . $language] = " selected=selected ";
         $markerArray["headertitle"] = $itsp->bLang->getLL("page.myinfo.title");
         $page = $dwoo->get($tpl, $markerArray);
         print $page;
     } else {
         print "access denied";
     }
 }
Пример #21
0
<?
$base_url = base_url();

?>
<? if (isValidUser()) { ?>
<div id="menubar" class="box">
    <div class="box-right"><div class="box-left">
        <div class="box-top">
            <div class="right"><div class="left"><span></span></div></div>
        </div>
        <div class="box-content">
        
            <ul class="menu"><?
            
            foreach($views as $view)
            {
                $selected = "";
                if ($view["selected"])
                {
                    $selected = " class=\"selected\"";
                }
                echo "<li><a href=\"/dashboard/{$view['name']}\"$selected>{$view['display']}</a></li>";
            }
            
            $selected = "";
            if ($method == "settings")
            {
                $selected = " class=\"selected\"";
            }
            echo "<li><a href=\"/dashboard/settings\"$selected>Settings</a></li>";
            
function loginAnchor($logout_attributes = null, $login_attributes = null)
{
    $obj =& get_instance();
    $obj->lang->load('sentry');
    return isValidUser() ? anchor('auth/logout', $obj->lang->line('auth_logout_label'), $logout_attributes) : anchor('auth/index', $obj->lang->line('sentry_login_label'), $login_attributes);
}
Пример #23
0
    <body style="text-align: center;">
        <h2>Welcome to Online Address Book!</h2>
        <p>Please enter your login information</p>

        <?php 
require_once './Templates/session-start.req-inc.php';
$submitButtonValue = 'Login';
require_once './Templates/loginform.html.php';
?>
 
        <p>Not a member? Sign up <a href="Templates/Signup.html.php">here</a></p>
        <?php 
require './Functions/utils-function.php';
require './Functions/dbconnect.php';
require './Functions/login-function.php';
if (isPostRequest()) {
    $email = filter_input(INPUT_POST, 'email');
    $pass = filter_input(INPUT_POST, 'pass');
    $_SESSION['isValidUser'] = isValidUser($email, $pass);
}
?>

        <?php 
if (isset($_SESSION['isValidUser']) && $_SESSION['isValidUser'] === true) {
    header('Location: ./Site/index.php');
}
?>

    </body>
</html>
Пример #24
0
    <body>
        <form action="#" method="post">
            <label>Enter your Email Address</label>
            <input type="text" name="Email" placeholder="Email" value="">       <!--  form for the user to enter there login credentials-->
            <label>Enter your password</label>
            <input type="password" name="password" placeholder="Password">
            <input type="submit" name="subLogin" value="Login">
        </form>   
        <?php 
if (isPostRequest()) {
    $result = isValidEmail();
    if ($result === TRUE) {
        //validate the credentials
        $result2 = doesExistInDB();
        if ($result2 === TRUE) {
            $results3 = isValidUser();
            if ($results3 === true) {
                echo 'Successfully loged-in';
                session_starter();
                ?>
        <form action="./index.php" method="GET">
            <input type="submit" name="view" value="View-all">              <!-- link to view all-->
        </form>
        <?php 
            } else {
                echo 'incorrect email and password combination';
                //echo errors
            }
        } else {
            echo "That email is not currently in our database.";
        }
Пример #25
0
 public function update_word()
 {
     $this->load->model('langdb_model');
     $id = $this->input->post('id');
     if (isValidUser()) {
         $data = array('word' => $this->input->post('word'), 'meaning' => $this->input->post('meaning'), 'sample_sent' => $this->input->post('sample_sent'), 'english_equiv' => $this->input->post('english_equiv'), 'isloan_word' => $this->input->post('isloan_word'), 'isdisplay' => $this->input->post('isdisplay'), 'std_spelling' => $this->input->post('std_spelling'), 'pri_pos_id' => $this->input->post('pri_pos_id'), 'sec_pos_id' => $this->input->post('sec_pos_id') == "0" ? null : $this->input->post('sec_pos_id'), 'domain_id' => $this->input->post('domain_id'));
         $this->langdb_model->update_entry('ldb_word', 'id', $id, $data);
     } else {
         $this->unAuthorizeduser();
     }
 }
Пример #26
0
<?php

include_once "../init_backend.php";
$init = new init_backend();
$valid = isValidUser();
if (!$valid) {
    print "no access";
    exit;
}
include_once "../tasks_backend.php";
$task = new tasks_backend();
$task->setField($_POST["task"], "progress", $_POST["progress"]);
<?php

//Runs the database functions and verifies user.
if ($user != -1 && $password != -1) {
    dbconnect();
    if (isValidUser($user, $password) === FALSE) {
        $_SESSION['message'] = "Login Failed";
    } else {
        $_SESSION['login'] = true;
        $_SESSION['id'] = isValidUser($user, $password);
        header('Location: index.php');
    }
}
Пример #28
0
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">

    </head>
    <body>
        <?php 
include_once '../Includes/session-start.req-inc.php';
include_once '../Functions/dbconnect.php';
include_once '../Functions/login-function.php';
include_once '../Functions/utils-function.php';
if (isPostRequest()) {
    // User Inputs the Email & Password
    $email = filter_input(INPUT_POST, 'email');
    $pass = filter_input(INPUT_POST, 'password');
    // User Validation
    if (isValidUser($email, $pass)) {
        $_SESSION['isValidUser'] = true;
    } else {
        $results = 'Sorry please try again';
    }
}
// Adds to the Session Created by the Particular User
if (isset($_SESSION['isValidUser']) && $_SESSION['isValidUser'] === true) {
    include '../Includes/add-view.html.php';
}
?>
        
        <!-- Provides the Results of the Login Succession & the Login Form  -->
        
        <?php 
include '../Includes/results.html.php';
Пример #29
0
    </head>
    <body>
        <center>
        <?php 
require_once '/includes/session-start.req-inc';
include_once '/functions/dbconnect.php';
include_once '/functions/login-function.php';
include_once '/functions/signupFunction.php';
include_once '/functions/newContact-function.php';
include_once '/functions/update.php';
include_once '/functions/until.php';
$view = filter_input(INPUT_GET, 'view');
if (isPostRequest()) {
    $email = filter_input(INPUT_POST, 'email');
    $password = filter_input(INPUT_POST, 'pass');
    if (isValidUser($email, $password)) {
        $_SESSION['isValidUser'] = true;
        header('Location: index.php?view=userdefault');
    } else {
        if (!isset($_SESSION['isValidUser']) || $_SESSION['isValidUser'] !== true) {
            $results = 'Invalid Login. Sorry, please try again';
        }
    }
}
?>
        
    <nav>
        <ul>
                                                
        <?php 
if (isset($_SESSION['isValidUser']) && $_SESSION['isValidUser'] === true) {
Пример #30
0
if ($act == "logout") {
    $_SESSION['user'] = "";
    unset($_SESSION);
    unset($_SESSION["user"]);
    $error_msg = "Signed off.";
}
if (!isLogged()) {
    yourls_html_head('login');
    mu_html_menu();
    // Login form
    switch ($act) {
        case "login":
            $username = yourls_escape($_POST['username']);
            $password = $_POST['password'];
            if (!empty($username) && !empty($password)) {
                if (isValidUser($username, $password)) {
                    $token = getUserTokenByEmail($username);
                    $id = getUserIdByToken($token);
                    $_SESSION['user'] = array("id" => $id, "user" => $username, "token" => $token);
                    yourls_redirect("index.php");
                } else {
                    $error_msg = "Problems to login.";
                    require_once 'form.php';
                }
            }
            break;
        case "joinform":
            require_once 'formjoin.php';
            break;
        case "join":
            $username = yourls_escape($_POST['username']);