Commit 490b220d authored by Stacey Walker's avatar Stacey Walker
Browse files

Limit users in online side block



bug#794368

Change-Id: I5d658b6da7591accb5680a812f8759a2384ae5ac
Signed-off-by: default avatarStacey Walker <stacey@catalyst-eu.net>
parent cf8cb98a
...@@ -494,6 +494,15 @@ $siteoptionform = array( ...@@ -494,6 +494,15 @@ $siteoptionform = array(
'defaultvalue' => get_config('showonlineuserssideblock'), 'defaultvalue' => get_config('showonlineuserssideblock'),
'disabled' => in_array('showonlineuserssideblock', $OVERRIDDEN), 'disabled' => in_array('showonlineuserssideblock', $OVERRIDDEN),
), ),
'onlineuserssideblockmaxusers' => array(
'type' => 'text',
'size' => 4,
'title' => get_string('onlineuserssideblockmaxusers', 'admin'),
'description' => get_string('onlineuserssideblockmaxusersdescription', 'admin'),
'defaultvalue' => get_config('onlineuserssideblockmaxusers'),
'rules' => array('integer' => true, 'minvalue' => 0, 'maxvalue' => 100),
'disabled' => in_array('onlineuserssideblockmaxusers', $OVERRIDDEN),
),
'registerterms' => array( 'registerterms' => array(
'type' => 'checkbox', 'type' => 'checkbox',
'title' => get_string('registerterms', 'admin'), 'title' => get_string('registerterms', 'admin'),
...@@ -549,8 +558,8 @@ function siteoptions_submit(Pieform $form, $values) { ...@@ -549,8 +558,8 @@ function siteoptions_submit(Pieform $form, $values) {
'tagssideblockmaxtags', 'country', 'viewmicroheaders', 'userscanchooseviewthemes', 'tagssideblockmaxtags', 'country', 'viewmicroheaders', 'userscanchooseviewthemes',
'remoteavatars', 'userscanhiderealnames', 'antispam', 'spamhaus', 'surbl', 'anonymouscomments', 'disableexternalresources', 'remoteavatars', 'userscanhiderealnames', 'antispam', 'spamhaus', 'surbl', 'anonymouscomments', 'disableexternalresources',
'proxyaddress', 'proxyauthmodel', 'proxyauthcredentials', 'smtphosts', 'smtpport', 'smtpuser', 'smtppass', 'smtpsecure', 'proxyaddress', 'proxyauthmodel', 'proxyauthcredentials', 'smtphosts', 'smtpport', 'smtpuser', 'smtppass', 'smtpsecure',
'noreplyaddress', 'homepageinfo', 'showonlineuserssideblock', 'registerterms', 'allowmobileuploads', 'noreplyaddress', 'homepageinfo', 'showonlineuserssideblock', 'onlineuserssideblockmaxusers', 'registerterms',
'creategroups', 'createpublicgroups', 'allowgroupcategories', 'wysiwyg', 'allowmobileuploads', 'creategroups', 'createpublicgroups', 'allowgroupcategories', 'wysiwyg',
); );
$oldlanguage = get_config('lang'); $oldlanguage = get_config('lang');
$oldtheme = get_config('theme'); $oldtheme = get_config('theme');
......
...@@ -179,6 +179,7 @@ if ($institution || $add) { ...@@ -179,6 +179,7 @@ if ($institution || $add) {
} }
$data->theme = 'sitedefault'; $data->theme = 'sitedefault';
$data->defaultmembershipperiod = null; $data->defaultmembershipperiod = null;
$data->showonlineusers = 2;
$lockedprofilefields = array(); $lockedprofilefields = array();
$authtypes = auth_get_available_auth_types(); $authtypes = auth_get_available_auth_types();
...@@ -187,6 +188,7 @@ if ($institution || $add) { ...@@ -187,6 +188,7 @@ if ($institution || $add) {
$themeoptions['sitedefault'] = '- ' . get_string('sitedefault', 'admin') . ' (' . $themeoptions[get_config('theme')] . ') -'; $themeoptions['sitedefault'] = '- ' . get_string('sitedefault', 'admin') . ' (' . $themeoptions[get_config('theme')] . ') -';
uksort($themeoptions, 'theme_sort'); uksort($themeoptions, 'theme_sort');
$showonlineusersoptions = array('0' => get_string('none'), '1' => get_string('institutiononly', 'admin'), '2' => get_string('All', 'admin'));
$sitename = get_config('sitename'); $sitename = get_config('sitename');
safe_require('artefact', 'internal'); safe_require('artefact', 'internal');
...@@ -290,6 +292,14 @@ if ($institution || $add) { ...@@ -290,6 +292,14 @@ if ($institution || $add) {
'options' => $themeoptions, 'options' => $themeoptions,
'help' => true, 'help' => true,
); );
$elements['showonlineusers'] = array(
'type' => 'select',
'title' => get_string('showonlineusers', 'admin'),
'description' => get_string('showonlineusersdesc','admin'),
'defaultvalue' => $data->showonlineusers,
'collapseifoneoption' => true,
'options' => $showonlineusersoptions,
);
if ($USER->get('admin') || get_config_plugin('artefact', 'file', 'institutionaloverride')) { if ($USER->get('admin') || get_config_plugin('artefact', 'file', 'institutionaloverride')) {
$elements['defaultquota'] = array( $elements['defaultquota'] = array(
'type' => 'bytes', 'type' => 'bytes',
...@@ -436,6 +446,7 @@ function institution_submit(Pieform $form, $values) { ...@@ -436,6 +446,7 @@ function institution_submit(Pieform $form, $values) {
$newinstitution->displayname = $values['displayname']; $newinstitution->displayname = $values['displayname'];
$newinstitution->authplugin = empty($values['authplugin']) ? null : $values['authplugin']; $newinstitution->authplugin = empty($values['authplugin']) ? null : $values['authplugin'];
$newinstitution->showonlineusers = $values['showonlineusers'];
if (get_config('usersuniquebyusername')) { if (get_config('usersuniquebyusername')) {
// Registering absolutely not allowed when this setting is on, it's a // Registering absolutely not allowed when this setting is on, it's a
// security risk. See the documentation for the usersuniquebyusername // security risk. See the documentation for the usersuniquebyusername
......
...@@ -240,6 +240,8 @@ $string['institutionexpirynotification'] = 'Warning time for institution expiry' ...@@ -240,6 +240,8 @@ $string['institutionexpirynotification'] = 'Warning time for institution expiry'
$string['institutionexpirynotificationdescription'] = 'A notification message will be sent to site and institutional admins the long before a site expires'; $string['institutionexpirynotificationdescription'] = 'A notification message will be sent to site and institutional admins the long before a site expires';
$string['language'] = 'Language'; $string['language'] = 'Language';
$string['none'] = 'None'; $string['none'] = 'None';
$string['onlineuserssideblockmaxusers'] = 'Online users limit';
$string['onlineuserssideblockmaxusersdescription'] = 'The maximum number of users to display in the online users side block.';
$string['country'] = 'Country'; $string['country'] = 'Country';
$string['pathtoclam'] = 'Path to clam'; $string['pathtoclam'] = 'Path to clam';
$string['pathtoclamdescription'] = 'The filesystem path to clamscan or clamdscan'; $string['pathtoclamdescription'] = 'The filesystem path to clamscan or clamdscan';
...@@ -578,12 +580,14 @@ $string['loginasoverridepasswordchange'] = 'As you are masquerading as another u ...@@ -578,12 +580,14 @@ $string['loginasoverridepasswordchange'] = 'As you are masquerading as another u
// Institutions // Institutions
$string['Add'] = 'Add'; $string['Add'] = 'Add';
$string['all'] = 'All';
$string['admininstitutions'] = 'Administer Institutions'; $string['admininstitutions'] = 'Administer Institutions';
$string['adminauthorities'] = 'Administer Authorities'; $string['adminauthorities'] = 'Administer Authorities';
$string['addinstitution'] = 'Add Institution'; $string['addinstitution'] = 'Add Institution';
$string['authplugin'] = 'Authentication plugin'; $string['authplugin'] = 'Authentication plugin';
$string['deleteinstitution'] = 'Delete Institution'; $string['deleteinstitution'] = 'Delete Institution';
$string['deleteinstitutionconfirm'] = 'Are you really sure you wish to delete this institution?'; $string['deleteinstitutionconfirm'] = 'Are you really sure you wish to delete this institution?';
$string['institutiononly'] = 'Institution only';
$string['institutionaddedsuccessfully2'] = 'Institution added successfully'; $string['institutionaddedsuccessfully2'] = 'Institution added successfully';
$string['institutiondeletedsuccessfully'] = 'Institution deleted successfully'; $string['institutiondeletedsuccessfully'] = 'Institution deleted successfully';
$string['noauthpluginforinstitution'] = 'Your site administrator has not configured an authentication plugin for this institution.'; $string['noauthpluginforinstitution'] = 'Your site administrator has not configured an authentication plugin for this institution.';
...@@ -598,6 +602,8 @@ $string['registrationallowed'] = 'Registration allowed?'; ...@@ -598,6 +602,8 @@ $string['registrationallowed'] = 'Registration allowed?';
$string['registrationalloweddescription2'] = 'Whether users can register for your site for this institution using the registration form. If registration is off, non-members cannot request membership of the institution, and members cannot leave the institution or delete their user accounts voluntarily.'; $string['registrationalloweddescription2'] = 'Whether users can register for your site for this institution using the registration form. If registration is off, non-members cannot request membership of the institution, and members cannot leave the institution or delete their user accounts voluntarily.';
$string['defaultmembershipperiod'] = 'Default membership period'; $string['defaultmembershipperiod'] = 'Default membership period';
$string['defaultmembershipperioddescription'] = 'How long new members remain associated with the institution'; $string['defaultmembershipperioddescription'] = 'How long new members remain associated with the institution';
$string['showonlineusers'] = 'Show online users';
$string['showonlineusersdesc'] = 'The online users to show to members of this institution. With different settings the most permissive institution settings will be used.';
$string['authenticatedby'] = 'Authentication Method'; $string['authenticatedby'] = 'Authentication Method';
$string['authenticatedbydescription'] = 'How this user authenticates to Mahara'; $string['authenticatedbydescription'] = 'How this user authenticates to Mahara';
......
...@@ -143,6 +143,8 @@ $string['views'] = 'Pages'; ...@@ -143,6 +143,8 @@ $string['views'] = 'Pages';
// Online users sideblock strings // Online users sideblock strings
$string['onlineusers'] = 'Online users'; $string['onlineusers'] = 'Online users';
$string['lastminutes'] = 'Last %s minutes'; $string['lastminutes'] = 'Last %s minutes';
$string['allonline'] = 'Show all online users';
$string['noonlineusersfound'] = 'No online users found';
// Links and resources sideblock // Links and resources sideblock
$string['linksandresources'] = 'Links and Resources'; $string['linksandresources'] = 'Links and Resources';
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<FIELD NAME="suspended" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/> <FIELD NAME="suspended" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
<FIELD NAME="priority" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1"/> <FIELD NAME="priority" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1"/>
<FIELD NAME="defaultquota" TYPE="int" LENGTH="10" NOTNULL="false"/> <FIELD NAME="defaultquota" TYPE="int" LENGTH="10" NOTNULL="false"/>
<FIELD NAME="showonlineusers" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="2"/>
</FIELDS> </FIELDS>
<KEYS> <KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="name" /> <KEY NAME="primary" TYPE="primary" FIELDS="name" />
......
...@@ -2360,5 +2360,16 @@ function xmldb_core_upgrade($oldversion=0) { ...@@ -2360,5 +2360,16 @@ function xmldb_core_upgrade($oldversion=0) {
add_field($table, $field); add_field($table, $field);
} }
if ($oldversion < 2011060701) {
// site setting to limit online users count
set_config('onlineuserssideblockmaxusers', 10);
// instiutional setting to limit online users type
$table = new XMLDBTable('institution');
$field = new XMLDBField('showonlineusers');
$field->setAttributes(XMLDB_TYPE_INTEGER, 10, null, XMLDB_NOTNULL, null, null, null, 2);
add_field($table, $field);
}
return $status; return $status;
} }
...@@ -2278,15 +2278,51 @@ function profile_sideblock() { ...@@ -2278,15 +2278,51 @@ function profile_sideblock() {
* The time is configured by setting the 'accessidletimeout' configuration * The time is configured by setting the 'accessidletimeout' configuration
* option. * option.
* *
* NOTE: currently returns all online users, this might not be desirable on a * Limits the number of users to display based on the 'onlineuserssideblockmaxusers'
* really busy site. * site configuration option and the Institution specific 'showonlineusers' setting.
* If the user belongs to no institution (other than the standard 'mahara' one) then
* the decision will be to show ALL users by default.
*
*/ */
function onlineusers_sideblock() { function onlineusers_sideblock() {
global $USER; global $USER;
$onlineusers = get_records_select_array('usr', 'deleted = 0 AND lastaccess > ?', // Determine what level of users to show
array(db_format_timestamp(time() - get_config('accessidletimeout'))), 'lastaccess DESC'); // 0 = none, 1 = institution/s only, 2 = all users
$showusers = 2;
$institutions = $USER->institutions;
if (!empty($institutions)) {
$showusers = 0;
foreach ($institutions as $i) {
if ($i->showonlineusers == 2) {
$showusers = 2;
break;
}
if ($i->showonlineusers == 1) {
$showusers = 1;
}
}
}
$maxonlineusers = get_config('onlineuserssideblockmaxusers');
switch ($showusers) {
case 0: // show none
return array(
'users' => array(),
'count' => 0,
'lastminutes' => floor(get_config('accessidletimeout') / 60),
);
case 1: // show institution only
$sql = 'SELECT u.* FROM usr u JOIN usr_institution i ON u.id = i.usr
WHERE i.institution IN ('.join(',', array_map('db_quote', array_keys($institutions))).')
AND lastaccess > ? AND deleted = 0 ORDER BY lastaccess DESC';
break;
case 2: // show all
$sql = 'SELECT * FROM usr WHERE lastaccess > ? AND deleted = 0 ORDER BY lastaccess DESC';
break;
}
$onlineusers = get_records_sql_array($sql, array(db_format_timestamp(time() - get_config('accessidletimeout'))), 0, $maxonlineusers);
if ($onlineusers) { if ($onlineusers) {
foreach ($onlineusers as &$user) { foreach ($onlineusers as &$user) {
if ($user->id == $USER->get('id')) { if ($user->id == $USER->get('id')) {
......
...@@ -720,6 +720,7 @@ function core_install_firstcoredata_defaults() { ...@@ -720,6 +720,7 @@ function core_install_firstcoredata_defaults() {
set_config('showonlineuserssideblock', 1); set_config('showonlineuserssideblock', 1);
set_config('footerlinks', serialize(array('privacystatement', 'about', 'contactus'))); set_config('footerlinks', serialize(array('privacystatement', 'about', 'contactus')));
set_config('searchusernames', 1); set_config('searchusernames', 1);
set_config('onlineuserssideblockmaxusers', 10);
// install the applications // install the applications
$app = new StdClass; $app = new StdClass;
......
...@@ -1256,7 +1256,7 @@ function load_user_institutions($userid) { ...@@ -1256,7 +1256,7 @@ function load_user_institutions($userid) {
throw new InvalidArgumentException("couldn't load institutions, no user id specified"); throw new InvalidArgumentException("couldn't load institutions, no user id specified");
} }
if ($institutions = get_records_sql_assoc(' if ($institutions = get_records_sql_assoc('
SELECT u.institution,'.db_format_tsfield('ctime').','.db_format_tsfield('u.expiry', 'membership_expiry').',u.studentid,u.staff,u.admin,i.theme,i.registerallowed SELECT u.institution,'.db_format_tsfield('ctime').','.db_format_tsfield('u.expiry', 'membership_expiry').',u.studentid,u.staff,u.admin,i.theme,i.registerallowed, i.showonlineusers
FROM {usr_institution} u INNER JOIN {institution} i ON u.institution = i.name FROM {usr_institution} u INNER JOIN {institution} i ON u.institution = i.name
WHERE u.usr = ? ORDER BY i.priority DESC', array($userid))) { WHERE u.usr = ? ORDER BY i.priority DESC', array($userid))) {
return $institutions; return $institutions;
...@@ -1478,6 +1478,30 @@ function build_userlist_html(&$data, $page, $admingroups) { ...@@ -1478,6 +1478,30 @@ function build_userlist_html(&$data, $page, $admingroups) {
$data['pagination_js'] = $pagination['javascript']; $data['pagination_js'] = $pagination['javascript'];
} }
function build_onlinelist_html(&$data, $page) {
if ($data['data']) {
$userdata = get_users_data($data['data'], $page);
}
$smarty = smarty_core();
$smarty->assign('data', isset($userdata) ? $userdata : null);
$smarty->assign('page', $page);
$resultcounttextsingular = get_string('user', 'group');
$resultcounttextplural = get_string('users', 'group');
$data['tablerows'] = $smarty->fetch('user/onlineuserresults.tpl');
$pagination = build_pagination(array(
'id' => 'onlinelist_pagination',
'url' => get_config('wwwroot') . 'user/' . $page . '.php',
'datatable' => 'onlinelist',
'count' => $data['count'],
'limit' => $data['limit'],
'offset' => $data['offset'],
'resultcounttextsingular' => $resultcounttextsingular,
'resultcounttextplural' => $resultcounttextplural,
'extradata' => array('page' => $page),
));
$data['pagination'] = $pagination['html'];
$data['pagination_js'] = $pagination['javascript'];
}
function get_institution_strings_for_users($userids) { function get_institution_strings_for_users($userids) {
$userlist = join(',', $userids); $userlist = join(',', $userids);
...@@ -1976,3 +2000,80 @@ function get_friends($userid, $limit=10, $offset=0) { ...@@ -1976,3 +2000,80 @@ function get_friends($userid, $limit=10, $offset=0) {
return $result; return $result;
} }
/**
* Get user records for online users page
*
* @param integer $limit
* @param integer $offset
*
* @returns array Total number of users, along with $limit or fewer user records.
*/
function get_onlineusers($limit=10, $offset=0, $orderby='firstname,lastname') {
global $USER;
// Determine what level of users to show
// 0 = none, 1 = institution/s only, 2 = all users
$showusers = 2;
$institutions = $USER->institutions;
if (!empty($institutions)) {
$showusers = 0;
foreach ($institutions as $i) {
if ($i->showonlineusers == 2) {
$showusers = 2;
break;
}
if ($i->showonlineusers == 1) {
$showusers = 1;
}
}
}
$result = array('count' => 0, 'limit' => $limit, 'offset' => $offset, 'data' => false);
switch ($showusers) {
case 0: // show none
return $result;
case 1: // show institution only
$sql = "SELECT * FROM usr JOIN usr_institution i ON id = i.usr
WHERE deleted = 0 AND lastaccess > ? AND i.institution IN (" . join(',',array_map('db_quote', array_keys($institutions))) . ")
ORDER BY $orderby";
$countsql = 'SELECT count(id) FROM usr JOIN usr_institution i ON id = i.usr
WHERE deleted = 0 AND lastaccess > ? AND i.institution IN (' . join(',',array_map('db_quote', array_keys($institutions))) . ')';
break;
case 2: // show all
$sql = "SELECT * FROM usr WHERE deleted = 0 AND lastaccess > ? ORDER BY $orderby";
$countsql = 'SELECT count(id) FROM usr WHERE deleted = 0 AND lastaccess > ?';
break;
}
$lastaccess = db_format_timestamp(time() - get_config('accessidletimeout'));
if (!$result['count'] = count_records_sql($countsql, array($lastaccess))) {
return $result;
}
$onlineusers = get_records_sql_array($sql, array($lastaccess), $offset, $limit);
if ($onlineusers) {
foreach ($onlineusers as &$user) {
if ($user->id == $USER->get('id')) {
// Use a shorter caching time for the current user, just in case they change their profile icon
$user->profileiconurl = get_config('wwwroot') . 'thumb.php?type=profileicon&id=' . $user->id . '&maxheight=20&maxwidth=20&earlyexpiry=1';
}
else {
$user->profileiconurl = profile_icon_url($user, 20, 20);
}
// If the user is an MNET user, show where they've come from
$authobj = AuthFactory::create($user->authinstance);
if ($authobj->authname == 'xmlrpc') {
$peer = get_peer($authobj->wwwroot);
$user->loggedinfrom = $peer->name;
}
}
}
else {
$onlineusers = array();
}
$result['data'] = array_map(create_function('$a', 'return $a->id;'), $onlineusers);
return $result;
}
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
defined('INTERNAL') || die(); defined('INTERNAL') || die();
$config = new StdClass; $config = new StdClass;
$config->version = 2011060700; $config->version = 2011060701;
$config->release = '1.5.0dev'; $config->release = '1.5.0dev';
$config->minupgradefrom = 2008040200; $config->minupgradefrom = 2008040200;
$config->minupgraderelease = '1.0.0 (release tag 1.0.0_RELEASE)'; $config->minupgraderelease = '1.0.0 (release tag 1.0.0_RELEASE)';
......
...@@ -215,7 +215,8 @@ td.narrow { ...@@ -215,7 +215,8 @@ td.narrow {
border-top: 1px solid #ccc; border-top: 1px solid #ccc;
} }
/* table with gap between rows */ /* table with gap between rows */
#friendslist td { #friendslist td,
#onlinelist td {
border-bottom: 2px solid #FFF; border-bottom: 2px solid #FFF;
} }
table.fixwidth { table.fixwidth {
...@@ -2144,7 +2145,8 @@ ul.friendinfo li.approvefriend form input:hover { ...@@ -2144,7 +2145,8 @@ ul.friendinfo li.approvefriend form input:hover {
padding-left: 10px; padding-left: 10px;
cursor: pointer; cursor: pointer;
} }
#friendslist ul.actionlist { #friendslist ul.actionlist,
#onlinelist ul.actionlist {
margin: 0 0 0 10px; margin: 0 0 0 10px;
float: right; float: right;
width: 180px; width: 180px;
...@@ -2174,14 +2176,16 @@ div.groupbox ul { ...@@ -2174,14 +2176,16 @@ div.groupbox ul {
div.groupbox li.last { div.groupbox li.last {
margin-top: 5px; margin-top: 5px;
} }
#friendslist ul.actionlist li { #friendslist ul.actionlist li,
#onlinelist ul.actionlist li {
list-style: none; list-style: none;
margin: 0; margin: 0;
border-top: 1px solid #d1d1d1; border-top: 1px solid #d1d1d1;
padding: 2px 3px; padding: 2px 3px;
line-height: 1.2em; line-height: 1.2em;
} }
#friendslist ul.actionlist li:first-child { #friendslist ul.actionlist li:first-child,
#onlinelist ul.actionlist li:first-child {
border-top: none; border-top: none;
} }
#editgroup th label { #editgroup th label {
...@@ -2190,25 +2194,30 @@ div.groupbox li.last { ...@@ -2190,25 +2194,30 @@ div.groupbox li.last {
form#search, form#filter, div.searchform, #searchviews { form#search, form#filter, div.searchform, #searchviews {
margin-bottom: 10px; margin-bottom: 10px;
} }
#friendslist ul.viewlist { #friendslist ul.viewlist,
#onlinelist ul.viewlist {
margin: 0; margin: 0;
font-size: .9167em; font-size: .9167em;
} }
#friendslist ul.viewlist li.label { #friendslist ul.viewlist li.label,
#onlinelist ul.viewlist li.label {
background: none; background: none;
padding-left: 0; padding-left: 0;
} }
#friendslist ul.viewlist li { #friendslist ul.viewlist li,
#onlinelist ul.viewlist li {
display: inline; display: inline;
margin: 0; margin: 0;
padding-left: 10px; padding-left: 10px;
background: url(../images/divider-dot.gif) no-repeat left; background: url(../images/divider-dot.gif) no-repeat left;
} }
#friendslist .leftdiv { #friendslist .leftdiv,
#onlinelist .leftdiv {
float: left; float: left;
width: 50px; width: 50px;
} }
#friendslist .rightdiv { #friendslist .rightdiv,
#onlinelist .rightdiv {
min-height: 35px; min-height: 35px;
padding: 5px 0 0 0; padding: 5px 0 0 0;
margin-left: 50px; margin-left: 50px;
......
...@@ -6,5 +6,6 @@ ...@@ -6,5 +6,6 @@
<li><a href="{$WWWROOT}user/view.php?id={$user->id}"><div class="profile-icon-container"><img src="{$user->profileiconurl}" alt=""></div>{$user|display_name}</a>{if $user->loggedinfrom} ({$user->loggedinfrom}){/if}</li> <li><a href="{$WWWROOT}user/view.php?id={$user->id}"><div class="profile-icon-container"><img src="{$user->profileiconurl}" alt=""></div>{$user|display_name}</a>{if $user->loggedinfrom} ({$user->loggedinfrom}){/if}</li>
{/foreach} {/foreach}
</ul> </ul>
<p id="allonline"><a href="{$WWWROOT}user/online.php">{str tag="allonline"}</a></p>
</div> </div>
{include file="header.tpl"}
<div id="onlinelistcontainer">
<div><p>({str tag="lastminutes" args=$lastminutes})</p></div>
<table id="onlinelist" class="fullwidth listing">
<tbody>
{$data.tablerows|safe}
</tbody>
</table>
</div>
{$data.pagination|safe}
{include file="footer.tpl"}
{if $data}
{foreach from=$data item=user}
<tr class="{cycle values='r0,r1'}">
<td class="onlineinfo">
<div class="leftdiv" id="onlineinfo_{$user->id}">
<img src="{profile_icon_url user=$user maxwidth=40 maxheight=40}" alt="">
</div>
<div class="rightdiv">
<h3><a href="{$WWWROOT}user/view.php?id={$user->id}">{$user->display_name}</a></h3>
</div>
</td>
</tr>
{/foreach}
{else}
<tr><td><div class="message">{str tag=noonlineusersfound section=mahara}</div></td></tr>
{/if}
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2011 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package mahara
* @subpackage core
* @author Stacey Walker
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL