Source for file masquerade.php
Documentation is available at masquerade.php
* Allow the admin user to masquerade as another user to make some bookings. A bit like "su".
* @author Stuart Prescott
* @copyright Copyright Stuart Prescott
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* path (bumblebee root)/inc/actions/masquerade.php
/** Load ancillary functions */
require_once 'inc/typeinfo.php';
require_once 'inc/bb/user.php';
require_once 'inc/formslib/anchortablelist.php';
require_once 'inc/actions/actionaction.php';
* Allow the admin user to masquerade as another user to make some bookings. A bit like "su".
* @param BumblebeeAuth $auth Authorisation object
* @param array $pdata extra state data from the call path
if (! isset
($this->PD['id'])) {
} elseif ($this->PD['id'] == -
1) {
echo
"<br /><br /><a href='".
makeURL('masquerade').
"'>".
T_('Return to user list').
"</a>";
echo
"<br /><br /><a href='".
makeURL('masquerade').
"'>".
T_('Return to user list').
"</a>";
* Print an HTML list of users to allow the user to masquerade as for making bookings
$select->connectDB('users', array('id', 'name', 'username'),'id!='.
qw($this->auth->uid));
$select->hrefbase =
makeURL('masquerade', array('id'=>
'__id__'));
$select->setFormat('id', '%s', array('name'), ' %s', array('username'));
if ($this->auth->amMasqed()) {
$select->list->prepend(array('-1', T_('End current Masquerade')));
echo
T_('Currently wearing the mask of:')
.
'<blockquote class="highlight">'
* Put on the selected mask
if ($row =
$this->auth->assumeMasq($this->PD['id'])) {
echo
'<h3>'.
T_('Masquerade started') .
'</h3>';
T_('<p>The music has started and you are now wearing the mask that looks like:</p><blockquote class="highlight">%s (%s)</blockquote><p>Is that a scary thought?</p>'),
.
T_('When you are tired of wearing your mask, remove it by returning to the "Masquerade" menu once more.')
.
T_('Note that even with your mask on, you can only edit/create bookings on instruments for which you have administrative rights.')
echo
'<div class="msgerror">';
echo
'<h3>'.
T_('Masquerade Error!') .
'</h3>';
.
T_('Sorry, but if you\'re comming to a masquerade ball, you really should wear a decent mask! Masquerade didn\'t start properly: mask failed to apply and music didn\'t start.')
.
T_('Are you sure you\'re allowed to do this?')
$this->auth->removeMasq();
echo
'<h3>' .
T_('Masquerade finished') .
'</h3>';
.
T_('Oh well. All good things have to come to an end. The music has stopped and you have taken your mask off. Hope you didn\'t get too much of a surprise when eveyrone else took their masks off too!')
Documentation generated on Tue, 06 Mar 2007 10:01:45 +0000 by phpDocumentor 1.3.0