File: select_user.php

package info (click to toggle)
webcalendar 0.9.45-4sarge7
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,888 kB
  • ctags: 4,775
  • sloc: php: 16,990; sql: 1,272; perl: 777; sh: 120; makefile: 45
file content (40 lines) | stat: -rw-r--r-- 1,092 bytes parent folder | download
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
<?php
include_once 'includes/init.php';
print_header();
?>

<h2><?php etranslate("View Another User's Calendar"); ?></h2>

<?php
if (( $allow_view_other != "Y" && ! $is_admin ) ||
   ( $public_access == "Y" && $login == "__public__" && $public_access_others != "Y")) {
  $error = translate ( "You are not authorized" );
}

if ( ! empty ( $error ) ) {
  echo "<blockquote>$error</blockquote>\n";
} else {
  $userlist = get_my_users ();
  if ($nonuser_enabled == "Y" ) {
    $nonusers = get_nonuser_cals ();
    $userlist = ($nonuser_at_top == "Y") ? array_merge($nonusers, $userlist) : array_merge($userlist, $nonusers);
  }
  ?>
  <form action="<?php echo $STARTVIEW;?>.php" method="get" name="SelectUser">
  <select name="user" onchange="document.SelectUser.submit()">
  <?php
  for ( $i = 0; $i < count ( $userlist ); $i++ ) {
    echo "<option value=\"".$userlist[$i]['cal_login']."\">".$userlist[$i]['cal_fullname']."</option>\n";
  }
  ?>
  </select>
  <input type="submit" value="<?php etranslate("Go")?>" /></form>
  <?php
}

?>
<br /><br />

<?php print_trailer(); ?>
</body>
</html>