summaryrefslogtreecommitdiff
path: root/doc/nils-diplom/Dateistruktur/admin/user_admin.php
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-30 15:43:52 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-30 15:43:52 +0100
commit8ea6ea6db019f68436a69f36aae55a9f205efa35 (patch)
tree5c367520523c42b1935491d199b4e8f3c17b4708 /doc/nils-diplom/Dateistruktur/admin/user_admin.php
parentec6e82dbcdc153b9973240cdff91a03b6d2dc886 (diff)
downloadsqltutor-plugin-8ea6ea6db019f68436a69f36aae55a9f205efa35.tar.gz
sqltutor-plugin-8ea6ea6db019f68436a69f36aae55a9f205efa35.tar.bz2
sqltutor-plugin-8ea6ea6db019f68436a69f36aae55a9f205efa35.zip
doc: Nils Weber doesnt have an 'e' in his firstname
Diffstat (limited to 'doc/nils-diplom/Dateistruktur/admin/user_admin.php')
-rwxr-xr-xdoc/nils-diplom/Dateistruktur/admin/user_admin.php406
1 files changed, 406 insertions, 0 deletions
diff --git a/doc/nils-diplom/Dateistruktur/admin/user_admin.php b/doc/nils-diplom/Dateistruktur/admin/user_admin.php
new file mode 100755
index 0000000..01e7578
--- /dev/null
+++ b/doc/nils-diplom/Dateistruktur/admin/user_admin.php
@@ -0,0 +1,406 @@
+<?php
+
+include("../header.php");
+
+if ($_SESSION['type'] == 0) // Session Zugangscheck für den Administrator
+ {
+
+ //print "<meta HTTP-EQUIV=\"Refresh\" CONTENT=5; URL=\"/dipl/praktikum.php\">";
+ print "<tr><td class=\"titel_15\">KEINE ADMINSESSION...</td></tr>";
+ print "<tr><td class=\"titel_15\">Bitte Loggen sie sich erneut als Admin ein...</td></tr>";
+ print "</td></tr></table></table>";
+ include("../footer.php");
+ exit;
+
+ }
+
+include("adminfuncs.php");
+
+if (isset($_POST['new_group']))
+{
+
+ add_group($_POST['gruppe']); //user anlegen
+
+}
+
+if (isset($_POST['add_user']))
+{
+
+ add_user($_POST['name'], $_POST['vorname'], $_POST['login'], $_POST['typ'], $_POST['user2group']); //user anlegen
+
+}
+
+if (isset($_POST['deakt_user']))
+{
+ $message = del_user($_POST['deakt_him']); //user deaktivieren
+ unset($message);
+}
+
+if (isset($_POST['akt_user']))
+{
+ $message = akt_user($_POST['akt_ihn']); //user deaktivieren
+ unset($message);
+}
+
+if (isset($_POST['chng_akt_group']))
+{
+ $message = akt_group($_POST['all_group']); //Gruppe komplett aktivieren
+ unset($message);
+}
+
+if (isset($_POST['chng_inakt_group']))
+{
+ $message = inakt_group($_POST['all_group']); //Gruppe komplett deaktivieren
+ unset($message);
+}
+
+
+?>
+
+<a name="start"></a>
+
+<tr>
+<td class="titel_15">NUTZERVERWALTUNG</td>
+</tr>
+<tr>
+<td>
+<table width=560>
+<form action="<?=$_POST['PHP_SELF'] . "?" . SID?>" method="post">
+
+ <tr><td colspan=3 class="titel"><br>einzelne aktuelle Nutzer deaktivieren...<?print $message;?></td></tr>
+ <tr><td colspan=3>&nbsp;</td></tr>
+ <tr><td class="text" width=50>USER</td>
+ <td width=100>
+ <select class="inputtext" name="deakt_him" size="1" width=95>
+
+ <?
+
+ $sql = "SELECT name FROM students where aktiv=1";
+
+ $stmt = dbconnect($sql);
+
+ OCIExecute($stmt);
+
+ $nrows = OCIFetchStatement($stmt, $results);
+
+
+ for ( $i = 0; $i < $nrows; $i++ )
+ {
+ reset($results);
+
+ while ( $column = each($results) )
+ {
+ $data = $column['value'];
+ //Liste mit vorhandenen Benutzern füllen
+ }
+
+ echo "<option>$data[$i]</option>\n";
+ }
+
+ ?>
+
+ </select>
+ </td>
+
+ <td align=right>
+ <input class="inputsubmit" type="Submit" name="deakt_user" value="inaktiv setzen">
+ </td>
+
+ </tr>
+</table>
+</form>
+
+<table width=560>
+<form action="<?=$_POST['PHP_SELF'] . "?" . SID?>" method="post">
+
+ <tr><td colspan=5 class="randoben">&nbsp;</td></tr>
+
+ <tr><td colspan=5 class="titel" >einzelne inaktive Nutzer aktivieren...nach Gruppen selektiert</td></tr>
+ <tr><td colspan=5>&nbsp;</td></tr>
+
+
+
+ <tr><td class="text" width=50>GRUPPE</td>
+ <td width=100>
+ <select type=submit class="inputtext" name="group" size="1" onchange="this.form.submit()" width=95>
+ <?
+
+ $sql = "SELECT distinct groups FROM students";
+
+ $stmt = dbconnect($sql);
+
+ OCIExecute($stmt);
+
+ $nrows = OCIFetchStatement($stmt, $results);
+
+
+ for ( $i = 0; $i < $nrows; $i++ )
+ {
+ reset($results);
+
+ while ( $column = each($results) )
+ {
+ $data = $column['value']; //Liste mit vorhandenen Benutzern füllen
+ }
+
+ if ($_POST['group'] == $data[$i]) print "<option selected>" . $data[$i] . "</option>\n"; else print "<option>$data[$i]</option>\n";
+ }
+
+ ?>
+
+ </select>
+ </td>
+
+
+ <td class="text" align=right width=200>inaktive Nutzer aus der Gruppe: <?print $_POST['group'];?></td>
+ <td>
+ <select class="inputtext" name="akt_ihn" size="1">
+ <?
+ $gruppe = $_POST['group'];
+
+ $sql = "SELECT name FROM students where aktiv=0 and groups='$gruppe'";
+
+ $stmt = dbconnect($sql);
+
+ OCIExecute($stmt);
+
+ $nrows = OCIFetchStatement($stmt, $results);
+
+
+ for ( $i = 0; $i < $nrows; $i++ )
+ {
+ reset($results);
+
+ while ( $column = each($results) )
+ {
+ $data = $column['value'];
+ //Liste mit vorhandenen Benutzern füllen
+ }
+
+ echo "<option>$data[$i]</option>\n";
+ }
+
+ ?>
+
+ </select>
+ </td>
+ <td align=right>
+ <input class="inputsubmit" type="Submit" name="akt_user" value="aktiv setzen">
+ </td>
+ </tr>
+ <tr><td colspan=5>&nbsp;</td></tr>
+</form>
+</table>
+
+
+
+<table width=560>
+<form action="<?=$_POST['PHP_SELF'] . "?" . SID?>" method="post">
+
+ <tr><td colspan=4 class="randoben">&nbsp;</td></tr>
+
+ <tr><td colspan=4 class="titel">gesamte Gruppen aktivieren oder deaktivieren...<?print $message;?></td></tr>
+ <tr><td colspan=4>&nbsp;</td></tr>
+ <tr><td class="text" width=50>GRUPPE</td>
+ <td width=100>
+ <select type=submit class="inputtext" name="all_group" size="1" onchange="this.form.submit()" width=95>
+ <?
+
+ $sql = "SELECT distinct groups FROM students";
+
+ $stmt = dbconnect($sql);
+
+ OCIExecute($stmt);
+
+ $nrows = OCIFetchStatement($stmt, $results);
+
+
+ for ( $i = 0; $i < $nrows; $i++ )
+ {
+ reset($results);
+
+ while ( $column = each($results) )
+ {
+ $data = $column['value']; //Liste mit vorhandenen Benutzern füllen
+ }
+
+ if ($_POST['all_group'] == $data[$i]) print "<option selected>" . $data[$i] . "</option>\n"; else print "<option>$data[$i]</option>\n";
+ }
+
+ ?>
+
+ </select>
+ </td>
+
+ <td align=right>
+ <input class="inputsubmit" type="Submit" name="chng_akt_group" value="Gr. aktiv setzen">
+ </td>
+ <td align=right>
+ <input class="inputsubmit" type="Submit" name="chng_inakt_group" value="Gr. inaktiv setzen">
+ </td>
+
+ </tr>
+ <tr><td>&nbsp;</td></tr>
+ </form>
+</table>
+
+<table width=560>
+<form action="<?=$_POST['PHP_SELF'] . "?" . SID?>" method="Post">
+
+
+ <tr><td colspan=3 class="randoben">&nbsp;</td></tr>
+
+ <tr>
+ <td valign="center" colspan=3 class="titel">Hinzufügen einzelner Nutzer zu bestehenden Gruppen<br></td>
+ </tr>
+ <tr><td colspan=3>&nbsp;</td></tr>
+
+<tr><td class="text" width=150>in welche GRUPPE einfügen?</td>
+ <td width=100>
+ <select type=submit class="inputtext" name="user2group" size="1" onchange="this.form.submit()" width=95>
+ <?
+
+ $sql = "SELECT groups FROM groups";
+ //$sql = "SELECT distinct groups FROM students";
+
+ $stmt = dbconnect($sql);
+
+ OCIExecute($stmt);
+
+ $nrows = OCIFetchStatement($stmt, $results);
+
+
+ for ( $i = 0; $i < $nrows; $i++ )
+ {
+ reset($results);
+
+ while ( $column = each($results) )
+ {
+ $data = $column['value']; //Liste mit vorhandenen Benutzern füllen
+ }
+
+ if ($_POST['user2group'] == $data[$i]) print "<option selected>" . $data[$i] . "</option>\n"; else print "<option>$data[$i]</option>\n";
+ }
+
+ ?>
+
+ </select>
+ </td>
+ </tr>
+
+
+ <tr>
+ <td class="text">NAME</td>
+ <td>
+ <input class="inputtext" type="title" name="name" size=40>
+ </td>
+ </tr>
+
+ <tr>
+ <td class="text">VORNAME</td>
+ <td>
+ <input class="inputtext" type="title" name="vorname" size=40>
+ </td>
+ </tr>
+
+ <tr>
+ <td class="text">LOGIN</td>
+ <td>
+ <input class="inputtext" type="Password" name="login" size=40>
+ </td>
+ </tr>
+
+ <tr><td>&nbsp;</td></tr>
+
+ <tr>
+ <td class="text">TYP</td>
+ <td>
+ <select class="inputtext" name="typ" size="1">
+ <option value=0>USER</option>
+ <option value=1>ADMIN</option>
+ </select>
+ </td>
+ <td>
+ <input class="inputsubmit" type="Submit" name="add_user" size="30" value="Nutzer in <?print $_POST['user2group'];?> anlegen">
+ </td>
+ </tr>
+
+ <tr><td>&nbsp;</td></tr>
+
+ </form>
+
+
+
+ </table>
+
+<table width=560>
+<form action="<?=$_POST['PHP_SELF'] . "?" . SID?>" method="post">
+ <tr><td colspan=5 class="randoben">&nbsp;</td></tr>
+ <tr><td colspan=3 class="titel">Neue Gruppe anlegen...</td></tr>
+ <tr><td colspan=3>&nbsp;</td></tr>
+ <tr><td class="text" width=50>Gruppenname:</td>
+ <td>
+ <input class="inputtext" type="title" name="gruppe" size=40>
+ </td>
+ <td align=right>
+ <input class="inputsubmit" type="Submit" name="new_group" value="Gruppe anlegen">
+ </td>
+
+ </tr>
+</table>
+</form>
+
+
+<table width=560>
+<form action="<?$_POST['PHP_SELF'] . SID?>" method="post" enctype="multipart/form-data">
+
+<tr><td colspan=5 class="randoben">&nbsp;</td></tr>
+<tr><td colspan=5 class="titel" >EXCEL-LISTE HOCHLADEN</td></tr>
+ <tr><td colspan=5>&nbsp;</td></tr>
+ <tr>
+ <td class=text>Bitte wählen Sie eine .XLS-Datei mit den Userdaten:
+ <input type="hidden" name="MAX_FILE_SIZE" value="100000">
+ <input class="inputsubmit" name="userfile" type="file" size="40" accept="*.xls"></td>
+ <td><br>
+ <input class="inputsubmit" type="submit" value="Upload File" name=upload align=right>
+ </td>
+ </tr>
+ <tr><td colspan=5>&nbsp;</td></tr>
+</form>
+
+<?
+
+$uploadDir = '/usr/local/apache/htdocs_ssl/dipl/admin/LIST/';
+$uploadFile = $uploadDir . $_FILES['userfile']['name'];
+
+if ( $_FILES['userfile']['type'] == "application/vnd.ms-excel" )
+{
+ $up = move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile);
+ $_SESSION['file'] = $_FILES['userfile']['name'];
+}
+
+if ( $up == 1 )
+{
+ print "<tr><td class=text>Datei ist akzeptiert und wurde erfolgreich hochgeladen. <br>";
+ print "<B>Debugging info:</B><br>" . "Datei: " . $_FILES['userfile']['name'] . "<br>Typ: " . $_FILES['userfile']['type'] . "<br>Größe: " . $_FILES['userfile']['size'] . " Byte";
+ print "</td></tr><tr><td colspan=5>&nbsp;</td></tr>";
+ print "<tr><td class=text><a href=get_user.php?".SID.">Zum Datenbankupload...</a></td></tr>";
+}
+elseif (isset($_POST['upload']))
+{
+ print "<tr><td class=text>Datei ist fehlerhaft oder keine EXCEL-DATEI und wurde nicht hochgeladen.<br>";
+ print "<B>Debugging info:</B><br>" . "Datei: " . $_FILES['userfile']['name'] . "<br>Typ: " . $_FILES['userfile']['type'] . "<br>Größe: " . $_FILES['userfile']['size'] . " Byte";
+}
+?>
+
+</table>
+
+ </td>
+</tr>
+</table>
+</table>
+
+
+<?
+include("../footer.php");
+?> \ No newline at end of file