Initial commit
[clearscm.git] / cc / msl / private / rmnusers.php
1 <!--
2 File:           rmnusers.php,v
3 Revision:       1.1.1.1
4
5 Description:    Remove a user to the exclusion list (-nusers). 
6
7 Author:         Andrew@DeFaria.com
8 Created:        Fri Jul 14 09:44:04 PDT 2006
9 Modified:       2007/05/17 07:45:48
10 Language:       PHP
11
12 (c) Copyright 2006, Andrew@DeFaria.com, all rights reserved.
13 -->
14
15 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
16    "http://www.w3.org/TR/html4/strict.dtd">
17 <html>
18 <head>
19   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
20   <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
21   <link rel="stylesheet" type="text/css" href="/css/default.css">
22 <?php
23 include_once ("../streams.php");
24 $version = "1.0";
25
26 # "Command line" parameters...
27 if (!empty ($_GET ["stream"])) {
28   $stream = $_GET ["stream"];
29 } // if 
30 if (!empty ($_GET ["user"])) {
31   $user = $_GET ["user"];
32 } // if 
33
34 if (!empty ($stream)) {
35   if (!empty ($user)) {
36     $heading = "Removing access of $user to $stream";
37   } else {
38     $heading = "Removing access of &lt;unknown&gt; to $stream";
39   } // if
40 } else {
41   $heading = "Removing access of $user to &lt;unknown&gt;";
42 } // if
43 ?>
44   <title><?php echo $heading?></title>
45 </head>
46
47 <center><h1><?php echo $heading?></h1></center>
48
49 <?php
50 // Santity check
51 if (empty ($stream)) {
52   error ("Stream parameter not supplied");
53 } // if
54
55 if (empty ($user)) {
56   error ("User parameter not supplied");
57 } // if
58
59 $nusers = get_nusers ($stream);
60
61 if (!is_member ($user, $nusers)) {
62   print "<font color=red><b>ERROR:</b></font> $user is already not allowed access to $stream<br>";
63 } else {
64   $nusers = remove_from_array ($user, $nusers);
65   $status = chnusers ($stream, $nusers);
66
67   if ($status == 0) {
68     print "$user is no longer allowed to access $stream";
69   } else {
70     print "<font color=red><b>ERROR:</b></font> Unable to remove $user from $stream";
71   } // if
72 } // if
73 ?>
74
75 <center>
76 <p><small><a href="/nusers_stream/lsnusers.php?stream=<?=$stream?>">Manage Stream Locks for <?=$stream?></a></small></p>
77 <?php copyright (null ,$version);?>
78 </center>
79 </body>
80 </html>