forked from craigk5n/webcalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselect_user.php
51 lines (45 loc) · 1.46 KB
/
select_user.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
include_once 'includes/init.php';
print_header();
echo '
<h2>' . translate ( 'View Another Users Calendar' ) . '</h2>';
if ( ( $ALLOW_VIEW_OTHER != 'Y' && ! $is_admin ) ||
( $PUBLIC_ACCESS == 'Y' && $login == '__public__' &&
$PUBLIC_ACCESS_OTHERS != 'Y' ) ) {
$error = print_not_auth();
echo '
<blockquote>' . $error . '</blockquote>';
} else {
$userlist = get_my_users ( '', 'view' );
if ( $NONUSER_ENABLED == 'Y' ) {
$nonusers = get_my_nonusers ( $login, true );
$userlist = ( $NONUSER_AT_TOP == 'Y'
? array_merge ( $nonusers, $userlist )
: array_merge ( $userlist, $nonusers ) );
}
if ( strstr ( $STARTVIEW, 'view' ) )
$url = 'month.php';
else {
$url = $STARTVIEW;
if ( $url == 'month' || $url == 'day' || $url == 'week' || $url == 'year' )
$url .= '.php';
}
echo '
<form class="form-inline" action="' . $url . '" method="get" name="SelectUser">
<select class="form-control" name="user" onchange="document.SelectUser.submit()">';
for ( $i = 0, $cnt = count ( $userlist ); $i < $cnt; $i++ ) {
// Don't list current user
if ( $login == $userlist[$i]['cal_login'] )
continue;
echo '
<option value="' . $userlist[$i]['cal_login'] . '">'
. $userlist[$i]['cal_fullname'] . '</option>';
}
echo '
</select>
<input class="btn btn-primary" type="submit" value="' . translate ( 'Go' ) . '" />
</form>';
}
echo '<br /><br />
' . print_trailer();
?>