1
+ − 1
<?php
+ − 2
47
+ − 3
/* PowerAdmin, a friendly web-based admin tool for PowerDNS.
+ − 4
* See <https://rejo.zenger.nl/poweradmin> for more details.
+ − 5
*
+ − 6
* Copyright 2007, 2008 Rejo Zenger <rejo@zenger.nl>
+ − 7
*
+ − 8
* This program is free software: you can redistribute it and/or modify
+ − 9
* it under the terms of the GNU General Public License as published by
+ − 10
* the Free Software Foundation, either version 3 of the License, or
+ − 11
* (at your option) any later version.
+ − 12
*
+ − 13
* This program is distributed in the hope that it will be useful,
+ − 14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
+ − 15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ − 16
* GNU General Public License for more details.
+ − 17
*
+ − 18
* You should have received a copy of the GNU General Public License
+ − 19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
+ − 20
*/
+ − 21
1
+ − 22
require_once ( "inc/toolkit.inc.php" );
+ − 23
+ − 24
if ( $_POST [ "commit" ])
+ − 25
{
+ − 26
if ( $_POST [ "username" ] && $_POST [ "level" ] && $_POST [ "fullname" ])
+ − 27
{
+ − 28
if ( ! isset ( $_POST [ "active" ]))
+ − 29
{
+ − 30
$active = 0 ;
+ − 31
}
+ − 32
else
+ − 33
{
+ − 34
$active = 1 ;
+ − 35
}
+ − 36
if ( edit_user ( $_POST [ "number" ], $_POST [ "username" ], $_POST [ "fullname" ], $_POST [ "email" ], $_POST [ "level" ], $_POST [ "description" ], $active , $_POST [ "password" ]))
+ − 37
{
73
+ − 38
clean_page ( "users.php" );
1
+ − 39
}
+ − 40
else
+ − 41
{
+ − 42
error ( "Error editting user!" );
+ − 43
}
+ − 44
}
+ − 45
}
+ − 46
+ − 47
include_once ( "inc/header.inc.php" );
+ − 48
+ − 49
if ( ! level ( 10 ))
+ − 50
{
13
+ − 51
error ( "You do not have the required access level." );
1
+ − 52
}
+ − 53
?>
71
+ − 54
<h2> <?php echo _ ( 'Edit user' ); ?> " <?php echo get_fullname_from_userid ( $_GET [ "id" ]) ?> "</h2>
+ − 55
<?php
1
+ − 56
$r = array ();
+ − 57
$r = get_user_info ( $_GET [ "id" ]);
+ − 58
?>
13
+ − 59
<form method="post">
71
+ − 60
<input type="HIDDEN" name="number" value=" <?php echo $_GET [ "id" ] ?> ">
13
+ − 61
<table>
+ − 62
<tr>
71
+ − 63
<td class="n"> <?php echo _ ( 'User name' ); ?> :</td>
+ − 64
<td class="n"><input type="text" class="input" name="username" value=" <?php echo $r [ "username" ] ?> "></td>
13
+ − 65
</tr>
+ − 66
<tr>
71
+ − 67
<td class="n"> <?php echo _ ( 'Full name' ); ?> :</td>
+ − 68
<td class="n"><input type="text" class="input" name="fullname" value=" <?php echo $r [ "fullname" ] ?> "></td>
13
+ − 69
</tr>
+ − 70
<tr>
71
+ − 71
<td class="n"> <?php echo _ ( 'Password' ); ?> :</td>
43
+ − 72
<td class="n"><input type="password" class="input" name="password" value=""></td>
13
+ − 73
</tr>
+ − 74
<tr>
71
+ − 75
<td class="n"> <?php echo _ ( 'E-mail' ); ?> :</td>
+ − 76
<td class="n"><input type="text" class="input" name="email" value=" <?php echo $r [ "email" ] ?> "></td>
13
+ − 77
</tr>
+ − 78
<tr>
71
+ − 79
<td class="n"> <?php echo _ ( 'User level' ); ?> :</td>
13
+ − 80
<td class="n">
+ − 81
<select name="level">
71
+ − 82
<option value="1" <?php if ( $r [ "level" ] == 1 ) { echo "selectED" ; } ?> >1 ( <?php echo _ ( 'Normal user' ); ?> )</option>
+ − 83
<option value="5" <?php if ( $r [ "level" ] == 5 ) { echo "selectED" ; } ?> >5 ( <?php echo _ ( 'Administrator' ); ?> )</option>
+ − 84
<option value="10" <?php if ( $r [ "level" ] == 10 ) { echo "selectED" ; } ?> >10 ( <?php echo _ ( 'Administrator w/ user admin rights' ); ?> )</option>
13
+ − 85
</select>
+ − 86
</td>
+ − 87
</tr>
+ − 88
<tr>
71
+ − 89
<td class="n"> <?php echo _ ( 'Description' ); ?> :</td>
13
+ − 90
<td class="n">
71
+ − 91
<textarea rows="6" cols="30" class="inputarea" name="description"> <?php echo $r [ "description" ] ?> </textarea>
13
+ − 92
</td>
+ − 93
</tr>
+ − 94
<tr>
71
+ − 95
<td class="n"> <?php echo _ ( 'Active' ); ?> :</td>
+ − 96
<td class="n"><input type="checkbox" name="active" value="1" <?php if ( $r [ "active" ]) { ?> CHECKED <?php } ?> ></td>
13
+ − 97
</tr>
+ − 98
<tr>
+ − 99
<td class="n"> </td>
71
+ − 100
<td class="n"><input type="submit" class="button" name="commit" value=" <?php echo _ ( 'Commit changes' ); ?> "></td>
13
+ − 101
</tr>
+ − 102
</table>
+ − 103
</form>
71
+ − 104
<?php
1
+ − 105
+ − 106
include_once ( "inc/footer.inc.php" );
+ − 107
+ − 108
?>