/** * returns the persons name replacing a pidm */ public static function get_name($pidm, $format = 'l, f') { $person = new PSUPerson($pidm); $name = $person->formatName($format); $person->destroy(); return $name; }
/** * Load in PSUPerson data for the list. */ public static function load_psuperson(&$v, $k) { $p = new PSUPerson($v['pid']); $v['certification_number'] = $p->certification_number; $v['idcard'] = $p->idcard(); $v['account_creation_date'] = $p->account_creation_date; unset($p); }
public function process() { $success = false; if ($this->psu_status == 'eod') { PSU::db('banner')->StartTrans(); $person = PSUPerson::get($this->ordernumber); if ($person->pidm) { if ($this->status_flag == 'success') { $appl_no = PSU::db('banner')->GetOne("SELECT appl_no FROM psu.v_ug_app WHERE pidm = " . $person->pidm); if ($appl_no) { $sql = "UPDATE sarchkl SET sarchkl_receive_date = sysdate WHERE sarchkl_pidm = " . $person->pidm . " AND sarchkl_appl_no = " . $appl_no . " AND sarchkl_admr_code = 'APFE'"; PSU::db('banner')->Execute($sql); } //end if } //end if $this->psu_status = 'loaded'; $this->save(); return PSU::db('banner')->CompleteTrans() ? $this->totalamount / 100 : false; } //end if } //end if PSU::db('banner')->CompleteTrans(false); return false; }
/** * deletes a \Rave\User and inactivates the phone */ public function delete() { $person = \PSUPerson::get($this->user->sisId); /** * Going through the delete process for the user will be determined * by whether or not we can successfully unconfirm the phone */ if ($person->emergency_phone && !$person->emergency_phone->unconfirm()) { throw new Exception('Unable to unconfirm the user\'s Rave phone'); } //end if return $this->user->delete(); }
/** * construct gateway URL */ public function url($processor, $params = false, $server = 'test', $type = 'commerce_manager') { $params = PSU::params($params); $person = PSUPerson::get($params['id']); $this->setURLParam('orderType', $processor); $this->setURLParam('amountDue', $params['amount']); $this->setURLParam('currentAmountDue', $params['current_amount']); $this->setURLParam('orderNumber', $params['id']); $this->setURLParam('orderName', $person->formatName('l, f m')); $this->setURLParam('orderDescription', $processor); $this->setURLParam('userChoice2', $params['term']); $server = 'prod'; return $this->_url($server, $type); }
/** * @brief initializes the default URL * * @param string $processor ECommerce Processor code * @param mixed $params Array or string list of parameters * @param string $server Nelnet server (test or prod) * @param string $type Type of link (commerce_manager or legacy) */ public function url($processor, $params = false, $server = 'test', $type = 'commerce_manager') { if (!is_array($params)) { parse_str($params, $params); } //end if $person = PSUPerson::get($params['id']); $this->setURLParam('orderType', $processor); $this->setURLParam('amountDue', $params['amount']); $this->setURLParam('orderNumber', $params['id']); $this->setURLParam('orderName', $person->formatName('l, f m')); $this->setURLParam('orderDescription', $processor); return $this->_url($server, $type); }
/** * reteive instructor data for the given type */ public function instructors($type = 'pidm') { $person_objects; if ($type == 'pidm') { return $this->instructors; } elseif ($type == 'PSUPerson') { if ($person_objects) { return $person_objects; } $person_objects = array(); foreach ($this->instructors as $key => $value) { $person_objects[$key] = \PSUPerson::get($value); } return $person_objects; } return null; }
public function url($user) { $person = PSUPerson::get($user); if (!$person->pidm) { return false; } $processor = 'Res Life FlexCash'; $server = $_SERVER['URANUS'] ? 'test' : 'prod'; $sql = "SELECT 1 \n\t\t FROM spbcard \n\t\t WHERE spbcard_pidm=" . preg_replace('/[^0-9]/', '', $person->pidm) . " \n\t\t AND (spbcard_student_status = 'AS' \n\t\t OR \n\t\t spbcard_employee_status = 'A'\n\t\t OR \n\t\t spbcard_employee_status IS NULL\n\t\t )"; if ($can_flex_cash = $GLOBALS['BANNER']->GetOne($sql)) { $this->setURLParam('orderType', $processor); $this->setURLParam('orderNumber', $person->username); $this->setURLParam('orderName', $person->formatName('l, f m')); $this->setURLParam('orderDescription', $processor); return $this->_url($server); } else { return false; } //end else }
public function url($user) { $person = PSUPerson::get($user); if (!$person->pidm) { return false; } $processor = 'IT Pay2Print'; $server = $_SERVER['URANUS'] ? 'test' : 'prod'; $params = array('id' => $person->id); if (!is_array($params)) { parse_str($params, $params); } //end if $person = PSUPerson::get($params['id']); $this->setURLParam('orderType', $processor); $this->setURLParam('amountDue', $params['amount']); $this->setURLParam('orderNumber', $params['id']); $this->setURLParam('orderName', $person->formatName('l, f m')); $this->setURLParam('orderDescription', $processor); $this->setURLParam('redirectUrl', $this->base_url . '/receipt.html'); $this->setURLParam('retriesAllowed', 5); $this->setURLParam('redirectUrlParameters', implode(',', $this->_redirect_params)); return $this->_url($server, $type); }
IDMObject::authN(); if (!IDMObject::authZ('role', 'myplymouth')) { die('no access'); } echo '<pre>'; PSU::get()->portal = PSU::db('portal_dev'); $sql = "SELECT DISTINCT wpid1 FROM relsearch WHERE substr(wpid1, 1, 1) <> 't'"; $wpids = PSU::db('portal')->GetCol($sql); $sql = "SELECT DISTINCT wp_id FROM usertabs WHERE wp_id != 0 AND substr(wp_id, 1, 1) <> 't'"; $wpids2 = PSU::db('portal')->GetCol($sql); $wpids = array_merge($wpids, $wpids2); $wpids = array_unique($wpids); sort($wpids); if (!$_GET['simple']) { echo "// append ?simple=1 to url to hide names\n\n"; } foreach ($wpids as $wpid) { $p = new PSUPerson($wpid); if ($_GET['simple'] == 1) { if ($p->wp_email) { echo $p->wp_email . ", "; } } else { if (PSU::is_wpid($wpid, PSU::MATCH_TEMPID)) { printf("%30s [%s] %s\n", "", $wpid, $p->wp_email); } else { printf("%30s [%s] %s\n", $p->first_name . " " . $p->last_name, $wpid, $p->wp_email); } } $p->destroy(); }
function addNewCall($new_call_form_vars, $call_location = '') { $query_status = ''; // Gets new call form variables from add_new_call.html $call_log = array(); $call_history = array(); // Vars going to addToCallLog--I laid them out in a way that matched the database. $call_log['call_id'] = ''; $person = new PSUPerson($new_call_form_vars['caller_user_name']); $call_log['wp_id'] = $person->wp_id; $call_log['pidm'] = $person->pidm ? $person->pidm : 0; $call_log['caller_username'] = PSU::nvl($person->username, $person->wp_id, $new_call_form_vars['caller_user_name']); //required $call_log['caller_first_name'] = stripslashes($person->formatName('f')); //required $call_log['caller_last_name'] = stripslashes($person->formatName('l')); //required $call_log['caller_phone_number'] = $new_call_form_vars['caller_phone_number']; //required $call_log['calllog_username'] = $_SESSION['username']; //required $call_log['call_type'] = $new_call_form_vars['resnet_check']; $call_log['call_time'] = 'NOW()'; $call_log['call_date'] = 'NOW()'; $call_log['keywords'] = stripslashes($new_call_form_vars['keywords_list']); $call_log['location_building_id'] = $new_call_form_vars['location_building_id']; $call_log['location_building_room_number'] = $new_call_form_vars['location_building_room_number']; $call_log['location_call_logged_from'] = $call_location; $call_log['title'] = stripslashes($new_call_form_vars['title']); $call_log['feelings'] = stripslashes($new_call_form_vars['feelings']); $call_log['feelings_face'] = $new_call_form_vars['feelings_face']; // If the new auto-incremented call_id was returned if ($new_call_id = $this->addToCallLog($call_log)) { // Vars going to addToCallHistory $call_history['id'] = ''; $call_history['call_id'] = $new_call_id; $call_history['updated_by'] = $_SESSION['username']; $call_history['tlc_assigned_to'] = $new_call_form_vars['tlc_assigned_to']; if ($call_history['tlc_assigned_to'] != "" && $call_history['tlc_assigned_to'] == "helpdesk") { $call_history['tlc_assigned_to'] = ""; } $call_history['its_assigned_group'] = $new_call_form_vars['its_assigned_group']; if ($call_history['its_assigned_group'] != "") { } $call_history['comments'] = stripslashes($new_call_form_vars['problem_details']); //required $call_history['date_assigned'] = 'NOW()'; $call_history['time_assigned'] = 'NOW()'; $call_history['call_status'] = $new_call_form_vars['call_status']; //required $call_history['call_priority'] = $new_call_form_vars['call_priority']; //required $call_history['call_state'] = $new_call_form_vars['call_state']; //required $call_history['current'] = 1; $status = $this->addToCallHistory($call_history); if (!$status) { $_SESSION['user_message'] = 'Error inserting new call into call_history table.'; } } else { $_SESSION['user_message'] = 'Error retrieving new auto-incremented call_id.'; } return $new_call_id; }
public function demerit_get($wpid) { $pidm = \PSUPerson::get($wpid)->pidm; $sql = "SELECT i.* FROM person_checklist_items i JOIN person_checklists c ON (i.checklist_id = c.id) WHERE c.pidm = ? AND i.response = ?"; $demerits = PSU::db('hr')->GetAll($sql, array($pidm, 'demerit')); return $demerits; }
/** * lazy load the person object */ public function _load_person() { $this->person = PSUPerson::get($this->wpid); }
/** * displays a ticket's public updates */ public function ticket($ticket) { IDMObject::authN(); $sql = "SELECT *,\n\t\t\t\t\t\t\t\t\t CONCAT(date_assigned, ' ', time_assigned) update_date\n\t\t\t FROM call_history\n\t\t\t\t\t\t WHERE call_id = ?\n AND (updated_by = ?\n\t\t\t\t\t\t OR\n\t\t\t\t\t\t tlc_assigned_to = ?\n\t\t\t\t\t\t\t\t\t\tOR\n\t\t\t\t\t\t\t\t\t\tupdated_by = ?\n\t\t\t\t\t\t\t\t\t\tOR\n\t\t\t\t\t\t\t\t\t\ttlc_assigned_to = ?\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t ORDER BY date_assigned, time_assigned"; $args = array($ticket, $this->myuser->login_name, $this->myuser->login_name, $this->myuser->wp_id, $this->myuser->wp_id); $details = PSU::db('calllog')->GetAll($sql, $args); foreach ($details as &$detail) { $p = new PSUPerson($detail['updated_by']); $detail['updated_by_name'] = $p->wp_id == $_SESSION['wp_id'] ? 'You' : $p->formatName('f'); $p->destroy(); unset($p); } //end foreach $sql = "SELECT call_status\n\t\t\t FROM call_history\n\t\t\t\t\t\t WHERE call_id = ? AND current = 1"; $args = array($ticket); $this->tpl->assign('call_status', PSU::db('calllog')->GetOne($sql, $args)); $this->tpl->assign('details', $details); $this->tpl->assign('ticket', $ticket); $tpl = new PSUSmarty(); $tpl->assign('hide_checklist', true); $tpl->assign('details_title', 'Update Ticket'); $form = $tpl->fetch(PSU_BASE_DIR . '/webapp/calllog/templates/ticket_form.tpl'); $this->tpl->assign('form', $form); $this->tpl->display('ticket.tpl'); }
function setUpPeopleList($people) { foreach ($people as $p) { $person = new PSUPerson($p['r_pidm'], array('address')); $p['username'] = $person->username; $p['city'] = $person->address['MA'][0]->city; $p['state'] = $person->address['MA'][0]->stat_code; $p['birthdate'] = date("m/d/Y", $person->birth_date); $p['hash'] = $this->createHash($p['r_pidm']); $peeps[] = $p; $person->destroy(); } return $peeps; }
/** * 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 //
function handleUserAction($action, $username) { if ($action) { $person = new PSUPerson($username); if ($person->pidm) { switch ($action) { case 'drive_quota': echo calcDriveQuota($person->username); break; case 'mail_quota': echo calcMailQuota($person->username); break; case 'view_ssn': if (IDMObject::authZ('permission', 'ape_ssn')) { $GLOBALS['LOG']->write('Viewing SSN', $person->login_name); $person->_load_ssn('//'); echo $person->ssn; } else { echo 'You do not have access to view this ssn.'; } //end else break; case 'view_pin_response': if (IDMObject::authZ('permission', 'ape_pin_hint')) { $GLOBALS['LOG']->write('Viewing Pin Response', $person->login_name); echo $person->security_response; } else { echo 'You do not have access to view this pin hint response.'; } //end else break; case 'view_cert': if (IDMObject::authZ('permission', 'ape_ssn')) { $GLOBALS['LOG']->write('Viewing Foreign Cert Number', $person->login_name); echo $person->certification_number; } else { echo 'You do not have access to view this cert number.'; } //end else break; case 'view_foreign_ssn': if (IDMObject::authZ('permission', 'ape_ssn')) { $GLOBALS['LOG']->write('Viewing Foreign SSN', $person->login_name); echo $person->foreign_ssn; } else { echo 'You do not have access to view this foreign ssn.'; } //end else break; case 'add_workflow_hiring_roles': if (IDMObject::authZ('permission', 'ape_workflow')) { if (!$GLOBALS['Workflow']->isWorkflowUser($person->login_name)) { $attr = array('logonID' => $person->login_name, 'lastName' => $person->last_name, 'firstName' => $person->first_name, 'emailAddress' => $person->login_name . '@plymouth.edu'); $GLOBALS['Workflow']->createUser($attr); } $GLOBALS['Workflow']->addHiringRolesToUser($person->login_name); echo ' [Roles added]'; } else { echo 'You do not have access to modify foreign data.'; } //end else break; } //end switch } else { echo 'Invalid pidm'; } //end else } //end if }
/** * lazy loads an array of active advisor records */ protected function _load_advisors() { $this->advisors = array(); $query = "SELECT *\n\t\t\t\t\t\t\t FROM sgradvr a,spriden\n\t\t\t\t\t\t\tWHERE a.sgradvr_pidm = :pidm\n\t\t\t\t\t\t\t\tAND a.sgradvr_advr_pidm = spriden_pidm\n\t\t\t\t\t\t\t\tAND spriden_change_ind is null\n\t\t\t\t\t\t\t\tAND a.sgradvr_term_code_eff =\n\t\t\t\t\t\t\t\t\t\t\t(SELECT MAX (b.sgradvr_term_code_eff)\n\t\t\t\t\t\t\t\t\t\t\t\tFROM sgradvr b\n\t\t\t\t\t\t\t\t\t\t\t WHERE b.sgradvr_pidm = a.sgradvr_pidm\n\t\t\t\t\t\t\t\t\t\t\t\t AND b.sgradvr_term_code_eff <= :term_code)\n\t\t\t\t\t\t\t\tAND a.sgradvr_advr_pidm in\n\t\t\t\t\t\t\t\t\t\t\t(SELECT c.sgradvr_advr_pidm\n\t\t\t\t\t\t\t\t\t\t\t\t FROM sgradvr c\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE c.sgradvr_term_code_eff=a.sgradvr_term_code_eff\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND c.sgradvr_pidm=a.sgradvr_pidm)\n\t\t\t\t\t\t\t AND EXISTS (SELECT 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t FROM sgbstdn,sobcurr\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE sgbstdn_pidm = :pidm\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sgbstdn_stst_code = 'AS'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sgbstdn_styp_code <> 'X'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sgbstdn_levl_code=sobcurr_levl_code\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sgbstdn_degc_code_1=sobcurr_degc_code\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sgbstdn_program_1=sobcurr_program\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sobcurr_secd_roll_ind='Y'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sobcurr_term_code_init<=:term_code\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sgbstdn_term_code_eff =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (SELECT MAX (sg.sgbstdn_term_code_eff)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM sgbstdn sg\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE sg.sgbstdn_pidm = :pidm))\n\t\t\t\t\tORDER BY a.sgradvr_prim_ind DESC,\n\t\t\t\t\t\t\tspriden_last_name,\n\t\t\t\t\t\t\tspriden_first_name"; $args = array('pidm' => $this->pidm, 'term_code' => $this->term_code); if ($results = \PSU::db('banner')->Execute($query, $args)) { foreach ($results as $row) { $person = \PSUPerson::get($row['sgradvr_advr_pidm']); $person->advisor_term_code_eff = $row['sgradvr_term_code_eff']; $person->advisor_primary_ind = $row['sgradvr_prim_ind']; $this->data['advisors'][] = $person; } //end while } //end if }
/** * inits the person object * * @params $ident \b Person identifier OR PSUPerson object */ private function _init_person($ident) { if (is_object($ident)) { $this->person = $ident; } else { $this->person = \PSUPerson::get($ident); } //end if // throw an error if this person doesn't have a pidm if (!$this->person->pidm) { throw new \Exception('The Person with an identifier of ' . $ident . ' does not have a pidm'); } //end if }
public static function simple_search($search, $type = 'all') { global $db; $phonebook_search = array('all', 'name_first', 'name_last', 'email', 'phone'); $search_data = array(); $search_data['search_string'] = $_SESSION['search_string'] = stripslashes($search); $search_data['search_type'] = $_SESSION['search_type'] = $type; if (in_array($type, $phonebook_search)) { $search_results = phonebookSearch($search, $type); } switch ($search_data['search_type']) { case 'closed': $sql = "\n\t\t\t\t\tSELECT * \n\t\t\t\t\t\tFROM call_view \n\t\t\t\t\t WHERE caller_username = ?\n\t\t\t\t\t\t AND current='1' \n\t\t\t\t\t\t AND call_status = 'closed' \n\t\t\t\t\t ORDER BY call_date DESC, \n\t\t\t\t\t\t\t\t call_time DESC\n\t\t\t\t"; $results = $db->GetAll($sql, array($search_data['search_string'])); foreach ($results as $key) { $key['comments'] = substr($key['comments'], 0, 23) . '...'; $search_data['results'][] = array('key' => $key, 'search_string' => $search_data['search_string'], 'search_type' => $search_data['search_type']); } $search_data['fields'][1] = 'Call ID'; $search_data['fields'][2] = 'Name'; $search_data['fields'][3] = 'Call Date'; $search_data['fields'][4] = 'Call Time'; $search_data['fields'][5] = 'Comments'; $search_data['search_results_text'] = 'Calls By'; break; case 'computer': $hardware = searchHardwareInformation($search_data['search_string']); $username = explode("@", $hardware[0]['email']); $username = $username[0]; foreach ($hardware as $hardware_info) { $search_data['results'][] = array('HW_Key' => $hardware_info['id'], 'HW_IPName' => $hardware_info['computer_name'], 'HW_Username' => $username, 'MACAddress' => $hardware_info['mac_address'], 'IPAddress' => $hardware_info['ip_address'], 'search_string' => $search_data['search_string'], 'location' => $hardware_info['NodeName'], 'search_type' => $search_data['search_type']); } $search_data['fields'][1] = 'Computer Name'; $search_data['fields'][2] = 'MAC Address'; $search_data['fields'][3] = 'IP Address'; $search_data['fields'][4] = 'Location'; $search_data['search_results_text'] = 'Computer Name'; break; case 'ip': $HardwareInfo = $db->GetAll("SELECT * FROM hardware_inventory WHERE ip_address = ?", array($search_data['search_string'])); $username = explode("@", $HardwareInfo[0]['email']); $username = $username[0]; $search_results = phonebookSearch($username); $search_results = current($search_results); $search_data['results'][] = array('HW_Key' => $HardwareInfo[0]['id'], 'HW_IPName' => $HardwareInfo[0]['computer_name'], 'HW_Username' => $search_results['email'], 'HW_Name' => $search_results['name_full'], 'MACAddress' => $HardwareInfo[0]['mac_address'], 'IPAddress' => $HardwareInfo[0]['ip_address'], 'search_string' => $search_data['search_string'], 'search_type' => $search_data['search_type']); $search_data['fields'][1] = 'IP Address'; $search_data['fields'][2] = 'Name'; $search_data['fields'][3] = 'Username'; $search_data['fields'][4] = 'MAC Address'; $search_data['fields'][5] = 'Computer Name'; $search_data['search_results_text'] = 'IP Address'; break; case 'mac': $HardwareInfo = $db->GetAll("SELECT * FROM hardware_inventory WHERE upper(mac_address) = ?", array(strtoupper($search_data['search_string']))); $username = explode("@", $HardwareInfo[0]['email']); $username = $username[0]; $search_results = phonebookSearch($username); $search_results = current($search_results); $search_data['results'][] = array('HW_Key' => $HardwareInfo[0]['id'], 'HW_IPName' => $HardwareInfo[0]['computer_name'], 'HW_Username' => $search_results['email'], 'HW_Name' => $search_results['name_full'], 'MACAddress' => $HardwareInfo[0]['mac_address'], 'IPAddress' => $HardwareInfo[0]['ip_address'], 'search_string' => $search_data['search_string'], 'search_type' => $search_data['search_type']); $search_data['fields'][1] = 'MAC Address'; $search_data['fields'][2] = 'Name'; $search_data['fields'][3] = 'Username'; $search_data['fields'][4] = 'Computer Name'; $search_data['search_results_text'] = 'MAC Address'; break; case 'ticket': $ticket_number_results = searchTicketNumber($search_data['search_string']); if ($ticket_number_results['call_id'] != '') { $search_data['results'][] = array('call_id' => $ticket_number_results['call_id'], 'caller_username' => $ticket_number_results['caller_username'], 'caller_first_name' => $ticket_number_results['caller_first_name'], 'caller_last_name' => $ticket_number_results['caller_last_name'], 'caller_phone_number' => $ticket_number_results['caller_phone_number'], 'call_date' => $ticket_number_results['call_date'], 'call_time' => $ticket_number_results['call_time'], 'calllog_username' => $ticket_number_results['calllog_username'], 'search_string' => $search_data['search_string'], 'search_type' => $search_data['search_type'], $search_data['search_type'] . '_selected' => 'SELECTED'); } else { $tpl->assign('no_ticket', 'NO TICKET FOUND'); $tpl->parse('main.searchResults.no_ticket'); } $search_data['fields'][1] = 'Call ID'; $search_data['fields'][2] = 'Name'; $search_data['fields'][3] = 'Username'; $search_data['fields'][4] = 'Call Date/Time'; $search_data['fields'][5] = 'Call Log User'; $search_data['search_results_text'] = 'Ticket #'; break; case 'user': $results = $db->GetAll("SELECT * FROM call_log, call_history WHERE call_log.call_id = call_history.call_id AND call_log.calllog_username = '******'search_string']}' AND current='1' ORDER BY call_date DESC, call_time DESC"); foreach ($results as $key) { if ($key['comments'] != "") { $key['comments'] = substr($key['comments'], 0, 23) . '...'; } else { $key['comments'] = "Closed on Submit"; } $search_data['results'][] = array('key' => $key, 'search_string' => $search_data['search_string'], 'search_type' => $search_data['search_type']); } $search_data['fields'][1] = 'Call ID'; $search_data['fields'][2] = 'Name'; $search_data['fields'][3] = 'Call Date'; $search_data['fields'][4] = 'Call Time'; $search_data['fields'][5] = 'Comments'; $search_data['search_results_text'] = 'Calls By'; break; case 'wp_id': case 'all': case 'name_last': case 'name_first': case 'email': case 'phone': if ($search_data['search_type'] == 'wp_id') { $sql = "\n\t\t\t\t\t\tSELECT * \n\t\t\t\t\t\t\tFROM wp_users \n\t\t\t\t\t\t WHERE user_login LIKE ?\n\t\t\t\t\t"; $search_results = PSU::db('connect')->GetAll($sql, array($search_data['search_string'] . '%')); foreach ($search_results as &$record) { $person = new PSUPerson($record['user_login']); $record['identifier'] = $record['wp_id'] = $person->wp_id; $record['name_full'] = $person->formatName('f l'); $record['email'] = $person->username; $record['dept'] = 'Family Portal'; $person->destroy(); unset($person); } //end foreach } //end if foreach ($search_results as $k => $key) { $class_prepend = ''; if ($key['email']) { $display = "user_info"; if (!$key['identifier']) { $key['identifier'] = $key['email']; } //end if } else { $display = "no_username"; if (!$key['identifier']) { $key['identifier'] = $key['pidm']; } //end if } //end else $portal_roles = PSU::get('idmobject')->GetAllBannerRoles($key['pidm']); if (is_array($portal_roles) && in_array('alumni', $portal_roles)) { $class_prepend = 'Alumni' . ($class_prepend ? '/ ' . $class_prepend : ''); } //end if if (is_array($portal_roles) && in_array('student_account_active', $portal_roles)) { $class_prepend = 'Student' . ($class_prepend ? '/ ' . $class_prepend : ''); } //end if $key['dept'] = $class_prepend . ($key['dept'] ? '/ ' . $key['dept'] : ''); if ($key['pidm'] || $key['username'] || $key['wp_id']) { $where = array(); $args = array(); if ($key['pidm']) { $where[] = "call_log.pidm = ?"; $args[] = $key['pidm']; } //end if if ($key['username']) { $where[] = "call_log.caller_username = ?"; $args[] = $key['username']; } //end if if ($key['wp_id']) { $where[] = "call_log.wp_id = ?"; $args[] = $key['wp_id']; } //end if $where = implode(" OR ", $where); $getOpenCallInfo = $db->GetOne("SELECT * FROM call_log, call_history WHERE call_log.call_id = call_history.call_id AND call_history.call_status = 'open' AND ({$where}) AND call_history.current='1'", $args); $num_open_calls = $db->GetOne("SELECT count(*) FROM call_log, call_history WHERE call_log.call_id = call_history.call_id AND call_history.call_status = 'open' AND ({$where}) AND call_history.current='1'", $args); if ($num_open_calls >= 1) { $key['call_id'] = $getOpenCallInfo; $key['open_call'] = "(" . $num_open_calls . " Open)"; } //end if if ($key['major'] && $key['title']) { $key['major_title'] = substr($key['major'] . ' / ' . $key['title'], 0, 20); $key['major_title_full'] = $key['major'] . ' / ' . $key['title']; } else { $key['major_title'] = substr($key['major'] . ' ' . $key['title'], 0, 20); $key['major_title_full'] = $key['major'] . ' ' . $key['title']; } //end else } //end if $search_data['results'][] = array('key' => $key, 'search_string' => $search_data['search_string'], 'search_type' => $search_data['search_type']); } // end foreach $search_data['fields'][1] = 'Name'; $search_data['fields'][2] = 'Username'; $search_data['fields'][3] = 'Phone'; $search_data['fields'][4] = 'Major/Title'; $search_data['fields'][5] = 'Class/Dept'; switch ($search_data['search_type']) { case 'email': $search_data['search_results_text'] = 'User Name'; $search_data['five_selected'] = 'SELECTED'; break; case 'name_last': $search_data['search_results_text'] = 'Last Name'; $search_data['2_selected'] = 'SELECTED'; break; case 'name_first': $search_data['search_results_text'] = 'First Name'; $search_data['1_selected'] = 'SELECTED'; break; } //end switch break; } //end switch return $search_data; }
<?php $identifier = $_GET['identifier']; $action = PSU::nvl($_GET['action'], 'impersonate'); $redirect_id = $identifier; $reason = isset($_GET['reason']) ? $_GET['reason'] : null; try { if ($action == 'impersonate') { if (!$GLOBALS['ape']->canResetPassword()) { throw new Exception('You are not allowed to modify account locks.'); } $person = new PSUPerson($identifier); $redirect_id = PSU::nvl($person->wp_id, $person->id); $GLOBALS['LOG']->write('Impersonating account: ' . $reason, $person->login_name); $_SESSION['impersonate'] = TRUE; $_SESSION['impersonate_store'] = array('wp_id' => $_SESSION['wp_id'], 'username' => $_SESSION['username'], 'pidm' => $_SESSION['pidm'], 'fullname' => $_SESSION['fullname']); $_SESSION['wp_id'] = $person->wp_id; $_SESSION['username'] = PSU::nvl($person->login_name, $person->wp_id); $_SESSION['pidm'] = $person->pidm; $_SESSION['fullname'] = $person->formatName('f m l'); $_SESSION['phpCAS']['user'] = PSU::nvl($person->login_name, $person->wp_id); unset($_SESSION['AUTHZ']); if ($_SESSION['pidm']) { PSU::get('idmobject')->loadAuthZ($_SESSION['pidm']); } //end if unset($_SESSION['AUTHZ']['admin']); foreach ((array) $_SESSION['AUTHZ']['permission'] as $key => $value) { if (strpos($key, 'ape_') === 0) { unset($_SESSION['AUTHZ']['permission'][$key]); }
$GLOBALS['TEMPLATES'] = $GLOBALS['BASE_DIR'] . '/templates'; $GLOBALS['EMERGENCY_GROUP'] = 8306124; require_once 'klein/klein.php'; if (file_exists($GLOBALS['BASE_DIR'] . '/debug.php')) { include $GLOBALS['BASE_DIR'] . '/debug.php'; } IDMObject::authN(); /** * Routing provided by klein.php (https://github.com/chriso/klein.php) * Make some objects available elsewhere. */ respond(function ($request, $response, $app) { // initialize the template $app->tpl = new PSUTemplate(); // get the logged in user $app->user = PSUPerson::get($_SESSION['wp_id']); $app->groups = array(); // assign user to template $app->tpl->assign('user', $app->user); $app->config = new PSU\Config(); $app->config->load(); if ('Registered and confirmed' == $app->user->rave_state) { $rave_user = \PSU\Rave\User::get($app->user->wpid); $app->rave_user = $rave_user; // get the rave users groups for the app $app->user_groups = array(); foreach ($app->rave_user->groups() as $group) { $app->user_groups[] = $group->attributes()->__toString(); } //end foreach // assign all of the groups to the template
<?php require_once 'PrintUser.class.php'; if (in_array($_SESSION['tlc_position'], $_SESSION['priv_users']) || $_SESSION['tlc_position'] == 'shift_leader' || $_SESSION['tlc_position'] == 'supervisor') { $print_user = new PrintUser($_GET['pidm']); if ($print_user->username && $_GET['action'] == 'update') { $print_increased = false; $increase = $_GET['fund_increase']; if (in_array($increase, array(-20, -10, -5, -1, -0.1, 0.1, 1, 5, 10, 20))) { $print_increased = $print_user->adjustBalance($increase); $person = new PSUPerson($_GET['pidm']); if ($print_increased === true) { $call_data = array('call_log_username' => $_SESSION['username'], 'caller_first_name' => $person->formatName('f'), 'caller_last_name' => $person->formatName('l'), 'caller_user_name' => $person->username, 'call_status' => 'closed', 'call_priority' => 'normal', 'problem_details' => 'Added ' . number_format($increase, 2) . ' in print funds', 'keywords_list' => 'pquota'); $call_location = $GLOBALS['new_call']->returnCallLoggedFromLocation($_SERVER['REMOTE_ADDR']); $GLOBALS['new_call']->addNewCall($call_data, $call_location); $call_added = 'call_added'; echo number_format($print_user->balance + $increase, 2); } //end if } else { echo isset($print_user->balance) ? number_format($print_user->balance, 2) : number_format(20, 2); } //end else } //end if } else { echo 'invalid_privs'; } //end else
/** * updateNonEmployees * * loops over non-employees generated by generatePopulations() and * modifies/updates those people within the DATA_MART * * @since version 1.0.0 */ function updateNonEmployees() { echo $this->line . ":: Updating Non-Employees (count: " . $this->count['non_emps'] . ")" . $this->line; $i = 0; foreach ($this->non_emps as $row) { $person = new PSUPerson($row['pidm']); if ($person->pidm) { $classifications = $this->idm->getPersonAttributesByMeta($person->pidm, 'classification'); $person->classification = key($classifications['role']); $person->_load_ssn('//'); $person->attributes = $this->idm->getPersonAttributes($person->pidm); $person->data['flags'] = array(); $person->data['flags']['emp'] = isset($person->attributes['permission']['employee_list']) ? 1 : ''; $person->data['flags']['pat'] = isset($person->attributes['permission']['pat_list']) ? 1 : ''; $person->data['flags']['os'] = isset($person->attributes['permission']['os_list']) ? 1 : ''; $person->data['flags']['faculty'] = isset($person->attributes['permission']['faculty_list']) ? 1 : ''; $person->data['flags']['pa'] = isset($person->attributes['permission']['pa_list']) ? 1 : ''; $person->data['flags']['lecturer'] = isset($person->attributes['permission']['lecturer_list']) ? 1 : ''; $person->data['flags']['hourly'] = isset($person->attributes['permission']['hourly_list']) ? 1 : ''; $person->data['flags']['supervisor'] = isset($person->attributes['permission']['supervisor_list']) ? 1 : ''; $person->data['flags']['chair'] = isset($person->attributes['permission']['chair_list']) ? 1 : ''; $person->data['flags']['dept_contact'] = isset($person->attributes['permission']['dept_contact_list']) ? 1 : ''; $this->createTempRecord($person, 'NON-EMP'); $this->updateDatamart($person, false); //false == don't update datamart } //end if unset($person); $person = null; $i++; if ($i % 10 == 9) { gc_collect_cycles(); } //end if } //end foreach echo $this->line . ":: Finished Updating Non-Employees" . $this->line; }
/** * returns the person associated with this record */ public function person() { return \PSUPerson::get($this->psu_id); }
function sendOpenCallMail($call_info, $action) { global $db; $person_cache = array(); $call = $db->GetRow("SELECT * FROM call_log WHERE call_id = ?", array($call_info['call_id'])); $call_info['call_date'] = $call['call_date'] . ' ' . $call['call_time']; $headers = array(); $headers['content-type'] = 'text/html'; $caller = PSU::nvl($call_info['caller_wp_id'], $call_info['caller_pidm'], $call_info['call_log_username']); $caller_data = $GLOBALS['user']->getCallerData($caller); $logger = $person_cache[$call_info['call_log_username']] = PSUPerson::get($call_info['call_log_username']); $groupInfo = getGroupInfo($call_info['its_group_assigned_to']); $call_log_employee = checkEmployee($call_info['call_log_username']); $assigned_employee = checkEmployee($call_info['tlc_assigned_to']); $to = array(); // always send to the submitter if the submitter is an employee if ($call_log_employee) { if ($logger->system_account_exists) { $to[] = $logger->wp_email; } //end } else { $end_user_to = $logger->wp_email; } //end else if ($action == "its_staff") { $call_info['call_id'] = $call_info['new_call_id'] . $call_info['call_id']; $call_info['comments'] = $call_info['problem_details'] . $call_info['comments']; if ($call_info['tlc_assigned_to'] != "unassigned") { if ($assigned_employee) { $to[] = PSUPerson::get($call_info['tlc_assigned_to'])->wp_email; } elseif ($call_info['tlc_assigned_to'] == 'caller' && $call_info['call_id']) { $sql = "SELECT caller_username \n\t\t\t\t\t\t\t\t\tFROM call_log \n\t\t\t\t\t\t\t\t WHERE call_log.call_id = ?"; $end_user_to = $db->GetOne($sql, array($call_info['call_id'])); if ($end_user_to) { $end_user = PSUPerson::get($end_user_to); if ($end_user) { $end_user_to = $end_user->wp_email; } } //end if } else { $end_user = PSUPerson::get($call_info['tlc_assigned_to']); $end_user_to = $end_user->wp_email; } //end if } //end if if ($call_info['its_assigned_group'] != 0) { $sql = "SELECT email_to \n\t\t\t\t\t\t\t\tFROM itsgroups\n\t\t\t\t\t\t\t\t , call_log \n\t\t\t\t\t\t\t\t\t\t , call_history \n\t\t\t\t\t\t\t WHERE itsgroups.deleted = 0 \n\t\t\t\t\t\t\t\t AND call_log.call_id = call_history.call_id \n\t\t\t\t\t\t\t\t AND itsgroups.itsgroupid = ?\n\t\t\t AND call_log.call_id = ?"; $email_to = $db->GetOne($sql, array($call_info['its_assigned_group'], $call_info['call_id'])); if ($email_to == 'all') { $sql = "SELECT user_name\n\t\t\t\t\t\t\t\t\tFROM itsgroups\n\t\t\t\t\t\t\t\t\t , its_employee_groups\n\t\t\t\t\t\t\t\t\t , call_log_employee\n\t\t\t\t\t\t\t\t\tWHERE itsgroups.deleted = 0 \n\t\t\t\t\t\t\t\t\t\tAND call_log_employee.call_log_user_id = its_employee_groups.employee_id \n\t\t\t\t\t\t\t\t\t\tAND its_employee_groups.group_id = ?\n\t\t\t\t\t\t\t\t\t\tAND itsgroups.itsgroupid = its_employee_groups.group_id \n\t\t\t\t\t\t\t\t\t\tAND call_log_employee.status = 'active' \n\t\t\t\t AND its_employee_groups.option_id = '2'"; $email_list = $db->GetCol($sql, array($call_info['its_assigned_group'])); } else { $email_list = explode(',', $email_to); } //end else foreach ((array) $email_list as $identifier) { $user = PSUPerson::get($identifier); $to[] = $user->wp_email; } //end foreach } //end if if ($call_info['its_group_assigned_to'] != 0) { $subject = '[Call Log] [' . $groupInfo[1] . '] ' . $caller_data['name_full']; } else { $subject = '[Call Log] ' . $caller_data['name_full']; } $subject .= ' (#' . $call_info['call_id'] . ')'; if ($call_info['call_status'] == 'closed') { $subject .= ' [CLOSED]'; // always send close to the owner, if they are allowed to see the // full history $caller_identifier = $db->GetOne("SELECT calllog_username FROM call_log WHERE call_log.call_id = '{$call_info['call_id']}'"); $caller_user = PSUPerson::get($caller_identifier); if ($GLOBALS['end_user_email']) { $closing_user = PSUPerson::get($_SESSION['wp_id']); if ($caller_user->wp_email == $closing_user->wp_email) { $end_user_to = $closing_user->wp_email; } //end if } elseif (checkEmployee($caller_to)) { $to[] = $caller_user->wp_email; } //end else } $sql = "SELECT * \n\t\t\t\t\t\t\tFROM call_log\n\t\t\t\t\t\t\t , call_history \n\t\t\t\t\t\t WHERE call_log.call_id = ?\n\t\t\t\t\t\t\t AND call_log.call_id = call_history.call_id\n\t\t\t\t\t\t ORDER BY date_assigned DESC\n\t\t , time_assigned DESC"; $call_info_query = $db->Execute($sql, array($call_info['call_id'])); foreach ($call_info_query as $call_info2) { $group_name = getGroupInfo($call_info2['its_assigned_group']); if ($group_name[0] == '') { $group_name = 'Unassigned'; } else { $group_name = $group_name[0]; } $call_info2['group_name'] = $group_name; $call_info2['update_date'] = $call_info2['date_assigned'] . ' ' . $call_info2['time_assigned']; if ($call_info2['tlc_assigned_to'] && $call_info2['tlc_assigned_to'] != 'unassigned') { if (!$person_cache[$call_info2['tlc_assigned_to']]) { $person_cache[$call_info2['tlc_assigned_to']] = PSUPerson::get($call_info2['tlc_assigned_to']); } //end else $call_info2['assigned_to'] = $call_info2['tlc_assigned_to']; } //end if if ($call_info2['updated_by']) { if (!$person_cache[$call_info2['updated_by']]) { $person_cache[$call_info2['updated_by']] = PSUPerson::get($call_info2['updated_by']); } //end else $call_info2['logger'] = $call_info2['updated_by']; } //end if $history[] = $call_info2; } $caller_id = $caller_data['identifier']; if (!$person_cache[$caller_id]) { $person_cache[$caller_id] = PSUPerson::get($caller_id); } //end else $current = array_slice($history, 0, 1); $current = $current[0]; // email ITS $tpl = new PSUTemplate(); $tpl->assign('caller', $caller_data); $tpl->assign('caller_id', $caller_id); $tpl->assign('pcache', $person_cache); $tpl->assign('call', $call_info); $tpl->assign('current', $current); $tpl->assign('history', array_slice($history, 1)); $text_message = $tpl->fetch('email.ticket.text.tpl'); $html_message = $tpl->fetch('email.ticket.html.tpl'); $to = implode(',', array_unique($to)); if ($to) { $headers['from'] = $logger->formatName('f l') . ' <' . $logger->wp_email . '>'; PSU::mail($to, $subject, array($text_message, $html_message), $headers); } //end if // email user if ($end_user_to) { $headers['from'] = 'Support Tickets <*****@*****.**>'; $tpl->assign('is_caller', true); $tpl->assign('history', array()); $text_message = $tpl->fetch('email.ticket.text.tpl'); $html_message = $tpl->fetch('email.ticket.html.tpl'); PSU::mail($end_user_to, $subject, array($text_message, $html_message), $headers); } //end if } }
/** * renders a template that displays relationships that have granted a specific permission */ function myrel_permission_grants($params, $type = 'select') { if (!$params['permission']) { return '<strong><code>Permission must be specified in order to use myrel_' . $type . '</code></strong>'; } //end if // instantiate a new smarty object because we don't want to inherit // or override any variables $tpl = new self(); if ($params['user'] instanceof \PSUPerson) { $myuser = $params['user']; } elseif ($params['user']) { $myuser = \PSUPerson::get($params['user']); } elseif ($_SESSION['wp_id']) { $myuser = \PSUPerson::get($_SESSION['wp_id']); } else { $myuser = \PSUPerson::get($_SESSION['pidm']); } //end else if ($params['selected'] instanceof \PSUPerson) { $selected_user = $params['selected']; } elseif ($params['selected']) { $selected_user = \PSUPerson::get($params['selected']); } //end else $myuser->pidm; if ($params['hide_self']) { if (!isset($myuser->pidm)) { $tpl->assign('family_member', true); } else { $tpl->assign('family_member', false); } } $tpl->assign('myuser', $myuser); $tpl->assign('selected', $selected_user); $tpl->assign('type', $type); $tpl->assign('permission', $params['permission']); $tpl->assign('identifier', $params['identifier'] ? $params['identifier'] : 'id'); if ($params['url']) { if (strpos($params['url'], '?') === false) { $tpl->assign('no_url_params', true); } $tpl->assign('url', $params['url']); } //end if //check if we want a question mark added to our identifier if ($params['no_qm']) { $tpl->assign('no_qm', true); } //end question mark check return $tpl->fetch(PSU_BASE_DIR . '/app/core/templates/myrelationships.permission_grants.tpl'); }
/** * constructor that accepts in either a pidm or a username, or a PSUPerson object * * @since version 1.0.0 * @param string $id PSUPerson, username, or pidm */ public function __construct($id) { if (is_object($id) && get_class($id) === 'PSUPerson') { $this->person = $id; } else { $this->person = PSUPerson::get($id); } if (!$this->person || !$this->person->hasSystemAccount()) { return; } $this->username = $this->person->username; $this->db = PSUDatabase::connect('mssql/printers2'); $this->load(); }
foreach ($response as $record) { $pdf->setTextColor(120, 7, 41); $prev_response = $record['response']; $pdf->Cell(25, 5, ' Marked as', 0, 0, 'L'); if ($record['response'] == 'incomplete') { $pdf->Cell(20, 5, 'incomplete', 0, 0, 'L'); $no_answer = 'f'; } elseif ($record['response'] == 'complete') { $pdf->Cell(20, 5, 'complete', 0, 0, 'L'); $no_answer = 'f'; } elseif ($record['response'] == 'n/a') { $pdf->Cell(20, 5, 'n/a', 0, 0, 'L'); $no_answer = 'f'; } $pdf->Cell(5, 5, 'by', 0, 0, 'L'); $responder = new PSUPerson($record['updated_by']); $record['updated_by'] = $responder->formatName('f m l'); $responder->destroy(); $pdf->Cell(80, 5, $record['updated_by'] . ' at ' . $record['activity_date'], 0, 1, 'L'); $pdf->setTextColor(0, 0, 0); if ($no_answer == 't') { $pdf->setTextColor(120, 7, 41); $pdf->Cell(190, 5, ' No action taken', 0, 1, 'L'); $pdf->setTextColor(0, 0, 0); $no_answer = 'f'; } if ($record['notes']) { $pdf->setTextColor(0, 0, 0); $pdf->Cell(95, 5, 'Do you have more details or anything else to add?', 0, 1, 'L'); $pdf->setTextColor(120, 7, 41); $pdf->Cell(190, 5, " " . $record['notes'], 0, 1, 'L');
/** * authorization of access */ public function authZ(&$person = null) { if (!$person instanceof PSUPerson) { $person = PSUPerson::get($person ? $person : $_SESSION['wp_id']); } //end if return true; }