WebCalendar PHP Cross Reference Groupware Applications

Source: /select_user.php - 60 lines - 1627 bytes - Summary - Text - Print

   1  <?php
   2  /* $Id: select_user.php,v 1.35.2.2 2008/02/12 01:47:52 cknudsen Exp $ */
   3  include_once  'includes/init.php';
   4  print_header ();
   5  echo '
   6      <h2>' . translate ( 'View Another Users Calendar' ) . '</h2>';
   7  
   8  if ( $ALLOW_VIEW_OTHER != 'Y' && ! $is_admin ) {
   9    $error = print_not_auth (7);
  10    echo '
  11      <blockquote>' . $error . '</blockquote>';
  12  } else if (  $PUBLIC_ACCESS == 'Y' && $login == '__public__' &&
  13    $PUBLIC_ACCESS_OTHERS != 'Y' ) {
  14    $error = print_not_auth (35);
  15    echo '
  16      <blockquote>' . $error . '</blockquote>';
  17  } else {
  18    $userlist = get_my_users ( '', 'view' );
  19    if ( $NONUSER_ENABLED == 'Y' ) {
  20      $nonusers = get_my_nonusers ( $login, true );
  21      $userlist = ( $NONUSER_AT_TOP == 'Y'
  22        ? array_merge ( $nonusers, $userlist )
  23        : array_merge ( $userlist, $nonusers ) );
  24    }
  25  
  26    if ( strstr ( $STARTVIEW, 'view' ) )
  27      $url = 'month.php';
  28    else {
  29      $url = $STARTVIEW;
  30      if ( $url == 'month' || $url == 'day' || $url == 'week' || $url == 'year' )
  31        $url .= '.php';
  32    }
  33  
  34    ob_start ();
  35  
  36    echo '
  37      <form action="' . $url . '" method="get" name="SelectUser">
  38        <select name="user" onchange="document.SelectUser.submit()">';
  39  
  40    for ( $i = 0, $cnt = count ( $userlist ); $i < $cnt; $i++ ) {
  41      // Don't list current user
  42      if ( $login == $userlist[$i]['cal_login'] )
  43        continue;
  44      echo '
  45          <option value="' . $userlist[$i]['cal_login'] . '">'
  46       . $userlist[$i]['cal_fullname'] . '</option>';
  47    }
  48  
  49    echo '
  50        </select>
  51        <input type="submit" value="' . translate ( 'Go' ) . '" />
  52      </form>';
  53  
  54    ob_end_flush ();
  55  }
  56  
  57  echo '<br /><br />
  58      ' . print_trailer ();
  59  
  60  ?>

title

Description

title

Description

title

Description

title

title

Body