#44 confirm angel types
parent
b3d4d7dc52
commit
77381ebca8
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
|
||||
// create admin_user_angeltypes permission/privilege and assign it to the archangel usergroup.
|
||||
if (sql_num_query("SELECT * FROM `Privileges` WHERE `name`='admin_user_angeltypes'") == 0) {
|
||||
sql_query("INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES ( NULL , 'admin_user_angeltypes', 'Confirm restricted angel types' );");
|
||||
$id = sql_id();
|
||||
sql_query("INSERT INTO `GroupPrivileges` SET `group_id`=-5, `privilege_id`=" . sql_escape($id));
|
||||
sql_query("INSERT INTO `Sprache` (
|
||||
`TextID` ,
|
||||
`Sprache` ,
|
||||
`Text`
|
||||
)
|
||||
VALUES (
|
||||
'admin_user_angeltypes', 'DE', 'Engeltypen freischalten'
|
||||
), (
|
||||
'admin_user_angeltypes', 'EN', 'Confirm angeltypes'
|
||||
);");
|
||||
$applied = true;
|
||||
}
|
||||
?>
|
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Auf dieser Seite können Erzengel Engeltypen für bestimmte Nutzer freischalten, z.B. nachdem diese für die Aufgabe geschult wurden.
|
||||
*/
|
||||
function admin_user_angeltypes() {
|
||||
if (isset ($_REQUEST['confirm']) && test_request_int('confirm') && sql_num_query("SELECT * FROM `UserAngelTypes` WHERE `id`=" . sql_escape($_REQUEST['confirm']) . " AND `confirm_user_id` IS NULL") > 0) {
|
||||
sql_query("UPDATE `UserAngelTypes` SET `confirm_user_id`=" . sql_escape($_SESSION['uid']) . " WHERE `id`=" . sql_escape($_REQUEST['confirm']) . " LIMIT 1");
|
||||
|
||||
success("Confirmed.");
|
||||
redirect(page_link_to('admin_user_angeltypes'));
|
||||
}
|
||||
|
||||
$users_source = sql_select("SELECT `UserAngelTypes`.`id`, `AngelTypes`.`name`, `User`.`Nick` FROM `UserAngelTypes` JOIN `AngelTypes` ON `UserAngelTypes`.`angeltype_id`=`AngelTypes`.`id` JOIN `User` ON `UserAngelTypes`.`user_id`=`User`.`UID` WHERE `AngelTypes`.`restricted`=1 AND `UserAngelTypes`.`confirm_user_id` IS NULL");
|
||||
$users = array ();
|
||||
foreach ($users_source as $user) {
|
||||
$user['actions'] = '<a href="' . page_link_to('admin_user_angeltypes') . '&confirm=' . $user['id'] . '">confirm</a>';
|
||||
$users[] = $user;
|
||||
}
|
||||
|
||||
return page(array (
|
||||
msg(),
|
||||
table(array (
|
||||
'Nick' => "Nick",
|
||||
'name' => "Angeltype",
|
||||
'actions' => ""
|
||||
), $users)
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Anzeige, ob noch Engeltypen bestätigt werden müssen. Damit werden Erzengel auf jeder Seite im Kopfbereich "genervt".
|
||||
*/
|
||||
function admin_new_user_angeltypes() {
|
||||
global $user, $privileges;
|
||||
|
||||
if (in_array("admin_user_angeltypes", $privileges)) {
|
||||
$unconfirmed_angeltypes = sql_num_query("SELECT * FROM `UserAngelTypes` JOIN `AngelTypes` ON `UserAngelTypes`.`angeltype_id`=`AngelTypes`.`id` WHERE `AngelTypes`.`restricted`=1 AND `UserAngelTypes`.`confirm_user_id` IS NULL LIMIT 1") > 0;
|
||||
|
||||
if ($unconfirmed_angeltypes)
|
||||
return info('<a href="' . page_link_to('admin_user_angeltypes') . '">There are unconfirmed angeltypes!</a>', true);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
?>
|
@ -1,162 +0,0 @@
|
||||
<p>
|
||||
%greeting%
|
||||
</p>
|
||||
<hr/>
|
||||
<p>
|
||||
%text_user_data%
|
||||
</p>
|
||||
<form action="%link%&action=setUserData" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
%label_nick%
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="nick" size="23" value="%nick%">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
%label_name%
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="name" size="23" value="%name%">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
%label_prename%
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="prename" size="23" value="%prename%">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
%label_age%
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="age" size="3" value="%age%">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
%label_tel%
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="tel" size="40" value="%tel%">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
%label_mobile%
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="mobile" size="40" value="%mobile%">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
%label_dect%
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="dect" size="4" value="%dect%">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
%label_mail%
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="mail" size="40" value="%mail%">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
ICQ
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="icq" size="40" value="%icq%">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
jabber
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="jabber" size="40" value="%jabber%">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
%label_hometown%
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="hometown" size="40" value="%hometown%">
|
||||
</td>
|
||||
</tr>%tshirts%
|
||||
</table><input type="submit" value="%label_save%">
|
||||
</form><hr/>
|
||||
<p>
|
||||
%text_password%
|
||||
</p>
|
||||
<form action="%link%&action=set" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
%current_pw_label%
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="current_pw" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
%new_pw_label%
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="new_pw" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
%new_pw2_label%
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="new_pw2" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
</table><input type="submit" value="%label_save%">
|
||||
</form><hr/>
|
||||
<p>
|
||||
%text_theme%
|
||||
</p>
|
||||
<form action="%link%&action=colour" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
%theme_label%
|
||||
</td>
|
||||
<td>
|
||||
%theme_select%
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="submit" value="%label_save%">
|
||||
</form><hr/>
|
||||
<p>
|
||||
%text_language%
|
||||
</p>
|
||||
<form action="%link%&action=sprache" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
%language_label%
|
||||
</td>
|
||||
<td>
|
||||
%language_select%
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="submit" value="%label_save%">
|
||||
</form>
|
@ -1,4 +0,0 @@
|
||||
<tr>
|
||||
<td>%label_size%</td>
|
||||
<td>%size_select%</td>
|
||||
</tr>
|
Loading…
Reference in New Issue