2 include_once $gfplugins.'webcalendar/www/includes/init.php';
3 print_header( '', '', '', true );
6 echo "<h2>" . translate("Error") . "</h2>\n" .
7 translate("You are not authorized") . ".\n";
8 echo "</body>\n</html>";
11 if ( ! $NONUSER_PREFIX ) {
12 echo "<h2>" . translate("Error") . "</h2>\n" .
13 translate("NONUSER_PREFIX not set") . ".\n";
14 echo "</body>\n</html>";
17 $add = getValue ( "add" );
18 $nid = getValue ( "nid" );
20 // Adding/Editing nonuser calendar
21 if (( ($add == '1') || (! empty ($nid)) ) && empty ($error)) {
22 $userlist = get_my_users ();
23 $button = translate("Add");
24 $nid = clean_html($nid);
27 <form action="edit_nonusers_handler.php" method="post">
29 if ( ! empty ( $nid ) ) {
30 nonuser_load_variables ( $nid, 'nonusertemp_' );
31 $id_display = "$nid <input type=\"hidden\" name=\"nid\" value=\"$nid\" />";
32 $button = translate("Save");
33 $nonusertemp_login = substr($nonusertemp_login, strlen($NONUSER_PREFIX));
35 $id_display = "<input type=\"text\" name=\"nid\" id=\"calid\" size=\"20\" maxlength=\"20\" /> " . translate ("word characters only");
39 if ( ! empty ( $nid ) ) {
40 nonuser_load_variables ( $nid, 'nonusertemp_' );
41 echo translate("Edit User");
43 echo translate("Add User");
48 <label for="calid"><?php etranslate("Calendar ID")?>:</label></td><td>
49 <?php echo $id_display ?>
52 <label for="nfirstname"><?php etranslate("First Name")?>:</label></td><td>
53 <input type="text" name="nfirstname" id="nfirstname" size="20" maxlength="25" value="<?php echo empty ( $nonusertemp_firstname ) ? '' : htmlspecialchars ( $nonusertemp_firstname ); ?>" />
56 <label for="nlastname"><?php etranslate("Last Name")?>:</label></td><td>
57 <input type="text" name="nlastname" id="nlastname" size="20" maxlength="25" value="<?php echo empty ( $nonusertemp_lastname ) ? '' : htmlspecialchars ( $nonusertemp_lastname ); ?>" />
60 <label for="nadmin"><?php etranslate("Admin")?>:</label></td><td>
61 <select name="nadmin" id="nadmin">
63 for ( $i = 0; $i < count ( $userlist ); $i++ ) {
64 echo "<option value=\"".$userlist[$i]['cal_login']."\"";
65 if (! empty ( $nonusertemp_admin ) &&
66 $nonusertemp_admin == $userlist[$i]['cal_login'] )
67 echo " selected=\"selected\"";
68 echo ">".$userlist[$i]['cal_fullname']."</option>\n";
75 <input type="submit" name="action" value="<?php echo $button;?>" />
76 <?php if ( ! empty ( $nid ) ) { ?>
77 <input type="submit" name="action" value="<?php etranslate("Delete");?>" onclick="return confirm('<?php etranslate("Are you sure you want to delete this entry?"); ?>')" />
81 <?php print_trailer ( false, true, true ); ?>