Пример #1
0
/**
* This file provides the output functions for
*  an interface for reserving resources,
*  viewing other reservations and modifying their own.
* @author Nick Korbel <*****@*****.**>
* @author David Poole <*****@*****.**>
* @author Richard Cantzler <*****@*****.**>
* @version 06-23-07
* @package Templates
*
* Copyright (C) 2003 - 2007 phpScheduleIt
* License: GPL, see LICENSE
*/
// Get Link object
$link = CmnFns::getNewLink();
/**
* Print out week being viewed above schedule tables
* @param array $d array of date information about this schedule
* @param string $title title of schedule
*/
function print_date_span($d, $title)
{
    // Print out current week being viewed
    // echo '<h3 align="center">' . $title . '<br/>' . Time::formatDate($d['firstDayTs']) . ' - ' . Time::formatDate($d['lastDayTs']) . '</h3>';
    // AK: Updated version. We want to display current date only.
    echo '<h3 align="center">' . Time::formatDate($d['todayTs']) . '</h3>';
}
/**
* Prints out a jump menu for the schedules
* @param array $links array of schedule links
Пример #2
0
 /**
  * Edits user data
  * @param array $data array of user data
  * @param bool if the admin is updating user data
  */
 function do_edit_user($data, $adminUpdate)
 {
     global $conf;
     $data['timezone'] = $conf['app']['default_timezone'];
     // Verify user data
     $msg = $this->check_all_values($data, true);
     if (!empty($msg)) {
         return $msg;
     }
     $this->db->update_user($data['memberid'], $data);
     if (!$adminUpdate) {
         $adminemail = strtolower($conf['app']['adminEmail']);
         // If it is the admin, set session variable
         if ($data['emailaddress'] == $adminemail) {
             $_SESSION['sessionAdmin'] = $adminemail;
         }
         // Set other session variables
         $_SESSION['sessionName'] = $data['fname'];
         $_SESSION['hourOffset'] = $data['timezone'] - $conf['app']['timezone'];
     }
     CmnFns::write_log('User data modified. Data provided: fname- ' . $data['fname'] . ' lname- ' . $data['lname'] . ' email- ' . $data['emailaddress'] . ' phone- ' . $data['phone'] . ' institution- ' . $data['institution'] . ' position- ' . $data['position'], $data['memberid']);
     $link = CmnFns::getNewLink();
     $url = 'ctrlpnl.php';
     if ($adminUpdate) {
         $url = 'admin.php?tool=users';
     }
     $this->success = translate('Your profile has been successfully updated!') . '<br/>' . $link->getLink($url, translate('Continue'));
 }
Пример #3
0
 /**
  * Sets the link class variable to reference a new Link object
  * @param none
  */
 function set_link()
 {
     $this->link = CmnFns::getNewLink();
 }
Пример #4
0
/**
* Prints out a login form and any error messages
* @param string $msg error messages to display for user
* @param string $resume page to resume on after login
*/
function printLoginForm($msg = '', $resume = '')
{
    global $conf;
    $link = CmnFns::getNewLink();
    $use_logonname = (bool) $conf['app']['useLogonName'] || (bool) $conf['ldap']['authentication'];
    $is_exceeded = false;
    // Check browser information
    echo '<script language="JavaScript" type="text/javascript">checkBrowser();</script>';
    if (isset($_SESSION['loginAttempts']) && $_SESSION['loginAttempts'] >= $conf['app']['loginAttempts']) {
        $msg .= translate('The number of login attempts is exceeded.') . '<br/>';
        $is_exceeded = true;
    }
    if (!empty($msg)) {
        CmnFns::do_error_box($msg, '', false);
    }
    if (!$is_exceeded) {
        ?>

<form name="login" method="post" action="<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
">
<table width="350px" border="0" cellspacing="0" cellpadding="1" align="center">
<tr>
  <td bgcolor="#CCCCCC">
	<table width="100%" border="0" cellspacing="0" cellpadding="3">
	  <tr bgcolor="#EDEDED">
		<td colspan="2" style="border-bottom: solid 1px #CCCCCC;">
		  <h5 align="center"><?php 
        echo translate('Please Log In');
        ?>
</h5>
		</td>
	  </tr>
	<?php 
        if ($conf['app']['wrlc']) {
            ?>
	  <tr bgcolor="#FFFFFF">
		<td>
		  <p><b><?php 
            echo translate('Last Name');
            ?>
</b></p>
		</td>
		<td>
		  <input type="password" name="name" class="textbox" />
		</td>
	  </tr>
	  <tr bgcolor="#FFFFFF">
		<td width="150">
		  <p><b><?php 
            echo translate("GWId");
            ?>
</b></p>
		</td>
		<td>
		  <input type="password" name="gwid" class="textbox" />
		</td>
	  </tr>  

	<?php 
        } else {
            ?>
	  <tr bgcolor="#FFFFFF">
		<td width="150">
		  <p><b><?php 
            echo translate($use_logonname ? 'Logon name' : 'Email address');
            ?>
</b></p>
		</td>
		<td>
		  <input type="text" name="email" class="textbox" />
		</td>
	  </tr>
	  <tr bgcolor="#FFFFFF">
		<td>
		  <p><b><?php 
            echo translate('Password');
            ?>
</b></p>
		</td>
		<td>
		  <input type="password" name="password" class="textbox" />
		</td>
	  </tr>
	<!--   AK: language selection is not required at this point
		<tr bgcolor="#FFFFFF">
		<td>
		  <p><b><?php 
            echo translate('Language');
            ?>
</b></p>
		</td>
		<td>
		<?php 
            CmnFns::print_language_pulldown();
            ?>
		</td>
	  </tr> -->
	  <tr bgcolor="#FFFFFF">
		<td>
		  <p><b><?php 
            echo translate('Keep me logged in');
            ?>
</b></p>
		</td>
		<td>
		  <input type="checkbox" name="setCookie" value="true" />
		</td>
	  </tr>
		<?php 
        }
        ?>
		
	  <tr bgcolor="#FAFAFA">
		<td colspan="2" style="border-top: solid 1px #CCCCCC;">
		   <p align="center">
			<input type="submit" name="login" value="<?php 
        echo translate('Log In');
        ?>
" class="button" />
			<input type="hidden" name="resume" value="<?php 
        echo $resume;
        ?>
" />
		  </p>
		  <?php 
        if ((bool) $conf['app']['allowSelfRegistration']) {
            ?>
		  <h4 align="center" style="margin-bottom:1px;"><b><?php 
            echo translate('First time user');
            ?>
			<?php 
            $link->doLink('register.php', translate('Click here to register'), '', '', translate('Register for phpScheduleIt'));
            ?>
		  </h4>
		  <?php 
        }
        ?>
		</td>
	  </tr>
	</table>
  </td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
	<td>
	Our login system currently cannot handle hyphenated names. If you have a hyphen in your name, please substitute a space for it when logging in.
	</td>
</tr>
<tr><td>&nbsp;</td></tr>
</table>
<?php 
    }
    ?>
<p align="center">
<?php 
    $link->doLink('roschedule.php', translate('View Schedule'), '', '', translate('View a read-only version of the schedule'));
    ?>
|
<?php 
    if (!$conf['app']['wrlc']) {
        $link->doLink('forgot_pwd.php', translate('I Forgot My Password'), '', '', translate('Retreive lost password'));
        ?>
|
<?php 
    }
    ?>

<?php 
    $link->doLink('javascript: help();', translate('Help'), '', '', translate('Get online help'));
    ?>
</p>
</form>
<?php 
}
Пример #5
0
/**
* Prints out a login form and any error messages
* @param string $msg error messages to display for user
* @param string $resume page to resume on after login
*/
function printLoginForm($msg = '', $resume = '')
{
    global $conf;
    $link = CmnFns::getNewLink();
    // Check browser information
    echo '<script language="JavaScript" type="text/javascript">checkBrowser();</script>';
    if (!empty($msg)) {
        CmnFns::do_error_box($msg, '', false);
    }
    ?>
<form name="login" method="post" action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
">
<table width="350px" border="0" cellspacing="0" cellpadding="1" align="center">
<tr>
  <td bgcolor="#CCCCCC">
	<table width="100%" border="0" cellspacing="0" cellpadding="3">
	  <tr bgcolor="#EDEDED">
		<td colspan="2" style="border-bottom: solid 1px #CCCCCC;">
		  <h5 align="center"><?php 
    echo translate('Please Log In');
    ?>
</h5>
		</td>
	  </tr>
	  <tr bgcolor="#FFFFFF">
		<td width="150">
		  <p><b><?php 
    echo translate('Login');
    ?>
</b></p>
		</td>
		<td>
		  <input type="text" name="email" class="textbox" />
		</td>
	  </tr>
	  <tr bgcolor="#FFFFFF">
		<td>
		  <p><b><?php 
    echo translate('Password');
    ?>
</b></p>
		</td>
		<td>
		  <input type="password" name="password" class="textbox" />
		</td>
	  </tr>
	  <?php 
    if ($conf['auth']['serverType'] === 'exchange') {
        ?>
	  <tr bgcolor="#FFFFFF">
		<td>
		  <p><b><?php 
        echo translate('Domain');
        ?>
</b></p>
		</td>
		<td>
		  <input type="text" name="domain" class="textbox" value="<?php 
        echo $conf['auth']['exch_domain'];
        ?>
"/>
		</td>
	  </tr>
	  <?php 
    }
    if ($conf['app']['selectLanguage']) {
        ?>
	  <tr bgcolor="#FFFFFF">
		<td>
		  <p><b><?php 
        echo translate('Language');
        ?>
</b></p>
		</td>
		<td>
		<?php 
        CmnFns::print_language_pulldown();
        ?>
		</td>
	  </tr>
	  <?php 
    }
    ?>
	  <tr bgcolor="#FFFFFF">
		<td>
		  <p><b><?php 
    echo translate('Keep me logged in');
    ?>
</b></p>
		</td>
		<td>
		  <input type="checkbox" name="setCookie" value="true" />
		</td>
	  </tr>
	  <tr bgcolor="#FAFAFA">
		<td colspan="2" style="border-top: solid 1px #CCCCCC;">
		   <p align="center">
			<input type="submit" name="login" value="<?php 
    echo translate('Log In');
    ?>
" class="button" />
			<input type="hidden" name="resume" value="<?php 
    echo $resume;
    ?>
" />
		  </p>
		</td>
	  </tr>
	</table>
  </td>
</tr>
</table>
<p align="center">
<?php 
    $link->doLink('javascript: help();', translate('Help'), '', '', translate('Get online help'));
    ?>
</p>
</form>
<?php 
}
Пример #6
0
/**
* Prints a message letting the user know that the update was successful
* @param none
*/
function print_success()
{
    $link = CmnFns::getNewLink();
    CmnFns::do_message_box(translate('Your email preferences were successfully saved') . '<br />' . $link->getLink('ctrlpnl.php', translate('Return to My Control Panel')));
}