Your UD college experience continues long after you graduate. We love to hear what our graduates are doing. We encourage you to stay connected to the school and build your social and professional network through our alumni-focused social channels and events. You can also support current students and show your Spartan pride by investing in UD. Wherever life takes you, you will always be part of the UD family.
Stay Connected
We're helping you keep in touch with your fellow Spartans no matter where they are in the world.
';
return $html;
}
//=====================================================================================================================
// show the login form when unsuccessful, redirect successfull
// @param boolean $successful the result from the login attempt
//=====================================================================================================================
public function showNext($successful){
if(!$successful){
//echo $this->getLoginForm(true);
$_SESSION['failedLogin']=1;
return;
}
unset($_SESSION['failedLogin']);
if(isset($_SESSION['requestedURI'])){
redirect($_SESSION['requestedURI']);
}else{
redirect('http://'.SITE_ROOT.'intranet/');
}
}
/**=======================================================================================================================
*
*=======================================================================================================================*/
public function log($msg, $file='ws_log.txt'){
// removed logging
}
//=======================================================================================================================
// web service master method
//=======================================================================================================================
protected function wsCall($data, $func){
curl_setopt($this->curl, CURLOPT_URL ,"http://".$this->settings['ws_host'].$this->settings["ws_path"].$func);
curl_setopt($this->curl, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($this->curl);
//$this->log("[".date('d.m.Y H:i:s')."] Service: ".$func."\\n".$data."\\n".$output."\\n========================================================");
return $output;
}
//=======================================================================================================================
// web service call: authentication/logout
//=======================================================================================================================
public function logoutAdmin(){
$data = '{"request":{}}';
$this->hasAdminSession = false;
if(!$result = $this->wsCall($data, "authentication/logout")){
return false; // no response
}
return true;
}
//=======================================================================================================================
// web service call: authentication/login
//=======================================================================================================================
function startAdminSession(){
if($this->hasAdminSession){
return true;
}
$data = '{"request":{"@username":"'.$this->settings['ws_user'].'","@password":"'.$this->settings['ws_password'].'"}}';
if(!$result = $this->wsCall($data, "authentication/login")){
$this->failedWSCall = true;
return false; // no response
}
// check the result
if(function_exists("json_decode")){
$result = json_decode($result, true);
return $this->hasAdminSession = (is_array($result) && isset($result['response']['user']['@id']));
}elseif($this->ZendJSON){
$result = Zend_Json::decode($result);
return $this->hasAdminSession = (is_array($result) && isset($result['response']['user']['@id']));
}else{
$re = '/"@id":"([0-9]+)"/';
$matches = array();
return $this->hasAdminSession = preg_match($re, $result, $matches);
}
}
//======================================================================================================================
//=======================================================================================================================
protected function validatePost(){
# 2-70 chars long
if(strlen($_POST['uname']) < 2 || strlen($_POST['uname']) > 70){
return false;
}
# 6-30 chars long
if(strlen($_POST['pwd']) < 6 || strlen($_POST['pwd']) > 30){
return false;
}
return true;
}
//=======================================================================================================================
// web service call: user/getUserById
//=======================================================================================================================
protected function getUserById($userID){
$data = '{request:{"@id" : "'.$userID.'" , "@extensible" : "true" }}';
if(!$result = $this->wsCall($data, "user/getUserById")){
$this->failedWSCall = true;
return false; // no responce
}
if(function_exists("json_decode")){
$result = json_decode($result, true);
return is_array($result) && isset($result['response']['user']) ? $result['response']['user'] : false;
}elseif($this->ZendJSON){
$result = Zend_Json::decode($result);
return is_array($result) && isset($result['response']['user']) ? $result['response']['user'] : false;
}else{
return false; // no JSON
}
}
//=======================================================================================================================
// web service call: user/getUserByUserName
//=======================================================================================================================
protected function getUserByUsername($username){
$data = '{request:{"@username" : "'.$username.'" , "@extensible" : "true" }}';
if(!$result = $this->wsCall($data, "user/getUserByUserName")){
$this->failedWSCall = true;
return false; // no responce
}
if(function_exists("json_decode")){
$result = json_decode($result, true);
return is_array($result) && isset($result['response']['user']['@id']) ? $result['response']['user'] : false;
}elseif($this->ZendJSON){
$result = Zend_Json::decode($result);
return is_array($result) && isset($result['response']['user']['@id']) ? $result['response']['user'] : false;
}else{
return false;
}
}
//=======================================================================================================================
protected function isValidLogin($result){
if(function_exists("json_decode")){
$result = json_decode($result, true);
$success = (is_array($result)
&& isset($result['response']['@valid'], $result['response']['@enabled'])
&& $result['response']['@valid'] == 'true'
&& $result['response']['@enabled'] == 'true');
}elseif($this->ZendJSON){
$result = Zend_Json::decode($result);
$success = (is_array($result)
&& isset($result['response']['@valid'], $result['response']['@enabled'])
&& $result['response']['@valid'] == 'true'
&& $result['response']['@enabled'] == 'true');
}else{
$re = '/"@valid":"true","@enabled":"true"/';
$matches = array();
$success = preg_match($re, $result);
}
return $success;
}
//=======================================================================================================================
// web service call: authentication/validateLogin
//=======================================================================================================================
public function checkCredentials(){
if(!$this->validatePost()){ // validation
return false; //invalid post
}
$success = false;
if(!$this->startAdminSession()){
return false; //can't start admin session
}
// try login
$data = '{"request":{"@username":"'.$_POST['uname'].'","@password":"'.$_POST['pwd'].'"}}';
if(!$result = $this->wsCall($data, "authentication/validateLogin")){
return false; // no response
}
$success = $this->isValidLogin($result);
if($success && $details = $this->getUserByUsername($_POST['uname'])){
$this->storeSessionDetails($details);
}
$this->logoutAdmin();
return $success;
}
//=======================================================================================================================
protected function storeSessionDetails($details){
$_SESSION['userID'] = $details['@id'];
// get user groups
$groups = isset($details["groups"]["group"]) ? $details["groups"]["group"] : false;
if(is_array($groups)){
if(isset($groups['@group_name'])){ // in case of a single group
$_SESSION['user_groups'][] = $groups['@group_name'];
}else{
foreach($groups as $group){
if(isset($group['@group_name'])){
$_SESSION['user_groups'][] = $group['@group_name'];
}
}
}
}
$_SESSION['user_name'] = $_POST['uname'];
$_SESSION['full_name'] = isset($details['@firstname'], $details['@lastname']) ? $details['@firstname'].' '.$details['@lastname'] : '';
}
//=======================================================================================================================
} // END SampleLogin
//===================================================================================================================
############################################## END CLASSES #########################################################
//===================================================================================================================
tryLogout();
// try login
if(isset($_POST['uname'], $_POST['pwd'])){
$login = new SampleLogin();
$login->showNext($login->checkCredentials());
}else{
redirectNonLogged();
}
if(!IS_LOGIN_PAGE && !IS_NOACCESS_PAGE && !userHasAccess()){
header("Location: http://" . SITE_ROOT . "/terminalfour/sample-site/" . "intranet/noaccess/?no_access=" . urlencode($_SERVER['REQUEST_URI']));
exit;
}
?>/media/Alumni/Homecoming2022-SavetheDate.jpg' loading="lazy" />
Homecoming 2022
Mark your calendar for October 20 -22. For all Homecoming details, including schedule of events, virtual opportunities, and hotel accommodations, click the button below!
On behalf of the University of Dubuque Alumni Association, I want to say "welcome home." As an alumna of UD, I want you to know that it is an honor to be working for you, my fellow alumni.
This is Spartan Nation, online! This site is designed to keep you informed of alumni news and events, and it is a great way for you to keep in touch with your alma mater and UD Alumni family that extends across the nation and around the globe. We are excited to share the latest University of Dubuque happenings and provide a place for our valued alumni to stay connected, no matter where you are. As an alumnus/alumna, you became part of a network of professionals and friends who support one another through life's journey.
The University of Dubuque strives to stay connected with our alumni and friends by sponsoring a variety of events to bring Spartans together on campus, across the country, and around the world. Our purpose is to stay connected with you, wherever you may be, and to provide the opportunity for alumni to gather and express their pride, gratitude, and Spartan Spirit.
There are several ways to stay connected: Check the calendar of events periodically to see if there are any events in your area; follow the University of Dubuque Alumni Association on Facebook and Twitter; give me a call at 563.589.3161 to schedule a tour of our ever-changing campus home; update your information and notify us of a big event such as a marriage, the birth of a child.
I look forward to the opportunity to welcome you back to your campus home!