<?php

/**
 * reset the expiration date on person_phone so that they are prompted to sign up with and re-confirm mobile number when logging into myPlymouth
 */
try {
    // can the user perform this action?
    if (!IDMObject::authZ('permission', 'mis') && !APEAuthZ::infodesk()) {
        throw new Exception('You are not authorized to reset emergency phone information.');
    }
    // end if
    // did we get all the needed data?
    if (!isset($_GET['wp_id'])) {
        throw new Exception('wp_id was missing in request.');
    }
    // end if
    $person = PSUPerson::get($_GET['wp_id']);
    if ($ok = $person->emergency_phone->unconfirm()) {
        $GLOBALS['LOG']->write('Emergency phone reset', $_GET['wp_id']);
        $response['message'] = 'Emergency number reset.  They will be prompted to confirm on next login (assuming they are a student/employee)';
        $response['status'] = 'success';
    } else {
        throw new Exception('Error resetting: ' . $ok);
    }
    // end else
} catch (Exception $e) {
    $response['message'] = $e->getMessage();
}
// end catch
//
// ajax requests end here
Esempio n. 2
0
$GLOBALS['USER_DB'] = PSUDatabase::connect('mysql/user_info-admin');
//$GLOBALS['EPO'] = PSUDatabase::connect('mssql/epo_mercury');
$GLOBALS['ASTER'] = PSUDatabase::connect('mysql/aster-misuser');
$GLOBALS['MYPLYMOUTH'] = PSUDatabase::connect('mysql/myplymouth');
/*******************[End Database Connections]*****************/
// which portal we are working in, for now there is only one, and we hardcode it!
$GLOBALS['Workflow'] = new Workflow();
$GLOBALS['BannerGeneral'] = new BannerGeneral($GLOBALS['BANNER']);
$GLOBALS['BannerStudent'] = new BannerStudent($GLOBALS['BANNER']);
$GLOBALS['PWMAN'] = new PasswordManager($GLOBALS['MYPLYMOUTH'], $_ = false, $GLOBALS['USER_DB']);
$GLOBALS['LOG'] = new PSULog('ape', $_SESSION['username']);
$GLOBALS['ZimbraAdmin'] = new zimbraAdmin();
/*******************[Authorization Stuff]*****************/
$GLOBALS['user_roles'] = PSU::get('idmobject')->getAllBannerRoles($_SESSION['username']);
$path_parts = pathinfo($_SERVER['SCRIPT_FILENAME']);
if (!IDMObject::authZ('role', 'staff') && !IDMObject::authZ('role', 'ape') && !APEAuthZ::infodesk() && !APEAuthZ::family() && !APEAuthZ::student() && !APEAuthZ::advancement() && !$_SESSION['impersonate']) {
    echo 'You (' . $_SESSION['username'] . ') do not have access to use this application.  If ' . $_SESSION['username'] . ' is not your username, please log in to <a href="http://go.plymouth.edu/logout">myPlymouth</a> and try again.';
    exit;
}
//end if
/*******************[End Authorization Stuff]*****************/
if ($_GET['mobile']) {
    $_SESSION['psu_mobile'] = true;
} elseif ($_GET['nomobile']) {
    $_SESSION['psu_mobile'] = false;
}
//end else
$GLOBALS['myuser'] = new PSUPerson($_SESSION['username']);
// first-time init. of error and message vars
if (!isset($_SESSION['errors'])) {
    $_SESSION['errors'] = $_SESSION['messages'] = array();
Esempio n. 3
0
 /**
  * Determine if the current user can reset passwords.
  */
 function canResetPassword()
 {
     return IDMObject::authZ('permission', 'ape_pw') || APEAuthZ::infodesk();
 }
 function __construct()
 {
     parent::__construct();
     // general template vars
     $this->assign('title', 'Analysis and Provisioning Engine');
     $this->assign('icon', $GLOBALS['ape']->icons);
     $this->template_dir = $GLOBALS['BASE_DIR'] . '/templates';
     // custom template functions
     $this->register_function('ape_bool', array($this, 'ape_bool'));
     $this->assign('username', $_SESSION['username']);
     $this->assign('ape', $GLOBALS['ape']);
     $this->assign('myuser', $GLOBALS['myuser']);
     $this->assign('infodesk', APEAuthZ::infodesk());
     // get svn dataz for this application
     $this->assign('svninfo', PSU::get_svn_info());
     $this->xhtml = false;
     $this->load_authz();
     /*** set up navigation links ***/
     $links = array('nav-home' => $this->createLink('Home', $GLOBALS['BASE_URL'] . '/', 'nav-icon nav-home', 'home'), 'nav-identity' => $this->createLink('Identity/Access', $GLOBALS['BASE_URL'] . '/user/' . $_SESSION['ape_identifier'], 'nav-identity', 'person'));
     if (APEAuthZ::advancement()) {
         $links['nav-advancement'] = $this->createLink('Advancement', $GLOBALS['BASE_URL'] . '/user/advancement/' . $_SESSION['ape_identifier'], 'nav-advancement', 'advancement');
         $this->assign('advancement_link', true);
     }
     //end if
     if (APEAuthZ::hr()) {
         $links['nav-hr'] = $this->createLink('HR', '#', 'nav-advancement', 'hr');
         $this->assign('hr_link', true);
     }
     //end if
     if (APEAuthZ::family()) {
         $links['nav-family'] = $this->createLink('Family', $GLOBALS['BASE_URL'] . '/user/family/' . $_SESSION['ape_identifier'], 'nav-family', 'family');
         $this->assign('family_link', true);
     }
     //end if
     if (APEAuthZ::student()) {
         $links['nav-student'] = $this->createLink('Student', $GLOBALS['BASE_URL'] . '/user/student/' . $_SESSION['ape_identifier'], 'nav-student', 'student');
         $this->assign('student_link', true);
     }
     //end if
     if ($_SESSION['AUTHZ']['admin']) {
         $links['nav-identity']['children'][] = $this->createLink('Access Management', $GLOBALS['BASE_URL'] . '/authz.html', 'nav-access', 'access');
     }
     if (IDMObject::authZ('permission', 'ape_mailing')) {
         $links['nav-identity']['children'][] = $this->createLink('Mailing Lists', $GLOBALS['BASE_URL'] . '/lists/', 'nav-mailing', 'mail');
     }
     if (IDMObject::authZ('oracle', 'reporting_security')) {
         $links['nav-identity']['children'][] = $this->createLink('Banner Security', $GLOBALS['BASE_URL'] . '/banner/', 'nav-banner', 'banner-security');
     }
     if ($GLOBALS['ape']->canResetPassword()) {
         $links['nav-identity']['children'][] = $this->createLink('Password Test', $GLOBALS['BASE_URL'] . '/password-test.html', 'nav-pass', 'password');
         $links['nav-identity']['children'][] = $this->createLink('Locked (' . $GLOBALS['ape']->locks_count() . ')', $GLOBALS['BASE_URL'] . '/locks.html', 'nav-locked', 'lock');
     }
     //end if
     $links['nav-identity']['children'][] = $this->createLink('Creation (' . $GLOBALS['ape']->pending_accounts_count() . ')', $GLOBALS['BASE_URL'] . '/pending.html', 'nav-pend-create', 'pending-creation');
     $links['nav-identity']['children'][] = $this->createLink('Deletion (' . $GLOBALS['ape']->pending_deletion_count() . ')', $GLOBALS['BASE_URL'] . '/deletion.html', 'nav-pend-delete', 'pending-deletion');
     if (IDMObject::authz('permission', 'mis')) {
         $links['nav-identity']['children'][] = $this->createLink('Provision/Deprovision Docs', 'https://docs.google.com/Doc?docid=0AcDtIeWVN6nGYWNmZ3dxamRqOW5jXzE0N2dndHBqNmZn&hl=en', 'nav-identity', 'identity');
     }
     //end if
     if (APEAuthZ::hr()) {
         $links['nav-hr']['children'][] = $this->createLink('Employee Clearance', $GLOBALS['BASE_URL'] . '/checklist-admin.html', 'nav-advancement', 'identity');
     }
     //end if
     // if there are only 2 root links, replace root link #2 with its children
     if (count($links) == 2) {
         $parent_link = array_pop($links);
         $links = array_merge($links, $parent_link['children']);
     }
     //end if
     $this->assign('nav_links', $links);
 }