Exemplo n.º 1
0
\Locale::setDefault($SESSION->lang);
$l10n->setLanguage($SESSION->lang);
//============================================================================================
// Model
//============================================================================================
$pro = new MyProfile($dbo);
//============================================================================================
// Attempt to log in the user
//============================================================================================
if ($_GET['page'] === 'login') {
    //attempt the login
    $login = $pro->attemptLogin($_POST['username'], $_POST['password']);
    if (!is_null($login)) {
        //retrieve profile information from database
        $results = $pro->getEmpByUserName($_POST['username']);
        $mod = $pro->getEmpModules($_POST['username']);
        \Zend_Session::regenerateId();
        // Set session variables relevant to that user
        $SESSION->user_id = $login['user_id'];
        $SESSION->user_name = $login['user_name'];
        $SESSION->user_first_name = $login['first_name'];
        $SESSION->is_admin = $login['is_admin'];
        $SESSION->first_name = $login['first_name'];
        $SESSION->last_name = $login['last_name'];
        $SESSION->last_logged_on = $login['last_logged_on'];
        $SESSION->department = $login['department'];
        $SESSION->department_group = $login['department_group'];
        $SESSION->modules = $mod;
        $loggers['audit']->info("User logged in");
        // Redirects if necessary
        if (!empty($_POST['next'])) {
Exemplo n.º 2
0
    $SESSION->lang = DEFAULT_LANGUAGE;
}
\Locale::setDefault($SESSION->lang);
$l10n->setLanguage($SESSION->lang);
//============================================================================================
// Model
//============================================================================================
$pro = new MyProfile($dbo);
$stats = new ProfileStatistics($dbo);
//============================================================================================
// Load the content
//============================================================================================
if (!isset($_GET['page'])) {
    $render = true;
    $emp = $pro->getEmpByUserName($SESSION->user_name);
    $modules = $pro->getEmpModules($SESSION->user_name);
    $all_emps = $pro->getAllEmps();
    foreach ($all_emps as $key => $a) {
        if (file_exists(FS_IMAGES . "/users/" . $a['user_name'] . ".jpg")) {
            $all_emps[$key]['emp_image'] = "https://" . URL_IMAGES . "/users/" . $a['user_name'] . ".jpg";
        } else {
            $all_emps[$key]['emp_image'] = "https://" . URL_IMAGES . "/users/default.jpg";
        }
    }
    $all_depts = $pro->getAllDepts();
    $all_modules = $pro->getAllModules();
    $distinctModules = $pro->getDistinctModules();
    $all_user_modules = $pro->getAllUserModules();
    if (!empty($SESSION->department)) {
        $appointment_types = \Ventus\Utilities\Functions::listAppointmentTypes($SESSION->department);
    }