| 1 |
<?php |
| 2 |
/** |
| 3 |
* adminSetup.php |
| 4 |
* |
| 5 |
* Shows the setup page at the admin panel. |
| 6 |
* |
| 7 |
* PHP versions 5 |
| 8 |
* |
| 9 |
* @category UserAccessManager |
| 10 |
* @package UserAccessManager |
| 11 |
* @author Alexander Schneider <alexanderschneider85@googlemail.com> |
| 12 |
* @copyright 2008-2010 Alexander Schneider |
| 13 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 |
| 14 |
* @version SVN: $Id$ |
| 15 |
* @link http://wordpress.org/extend/plugins/user-access-manager/ |
| 16 |
*/ |
| 17 |
|
| 18 |
if (isset($_POST['action'])) { |
| 19 |
$post_action = $_POST['action']; |
| 20 |
} else { |
| 21 |
$post_action = null; |
| 22 |
} |
| 23 |
|
| 24 |
if ($post_action == 'reset_uam') { |
| 25 |
if (isset($_POST['uam_reset'])) { |
| 26 |
$reset = $_POST['uam_reset']; |
| 27 |
} else { |
| 28 |
$reset = null; |
| 29 |
} |
| 30 |
|
| 31 |
if ($reset == 'true') { |
| 32 |
$userAccessManager = new UserAccessManager(); |
| 33 |
$userAccessManager->uninstall(); |
| 34 |
$userAccessManager->install(); |
| 35 |
?> |
| 36 |
<div class="updated"> |
| 37 |
<p><strong><?php echo TXT_UAM_RESET_SUC; ?></strong></p> |
| 38 |
</div> |
| 39 |
<?php |
| 40 |
} |
| 41 |
} |
| 42 |
?> |
| 43 |
|
| 44 |
<div class="wrap"> |
| 45 |
<form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>"> |
| 46 |
<input type="hidden" value="reset_uam" name="action" /> |
| 47 |
<h2><?php echo TXT_SETUP; ?></h2> |
| 48 |
<table class="form-table"> |
| 49 |
<tbody> |
| 50 |
<tr valign="top"> |
| 51 |
<th scope="row"><?php echo TXT_RESET_UAM; ?></th> |
| 52 |
<td> |
| 53 |
<label for="uam_reset_yes"> |
| 54 |
<input type="radio" id="uam_reset_yes" class="uam_reset_yes" name="uam_reset" value="true" /> |
| 55 |
<?php echo TXT_YES; ?> |
| 56 |
</label> |
| 57 |
<label for="uam_reset_no"> |
| 58 |
<input type="radio" id="uam_reset_no" class="uam_reset_no" name="uam_reset" value="false" checked="checked" /> |
| 59 |
<?php echo TXT_NO; ?> |
| 60 |
</label> |
| 61 |
<input type="submit" class="button" name="uam_reset_submit" value="<?php echo TXT_RESET; ?>" /> <br /> |
| 62 |
<p style="color: red; font-size: 12px; font-weight: bold;"> |
| 63 |
<?php echo TXT_RESET_UAM_DESC; ?> |
| 64 |
</p> |
| 65 |
</td> |
| 66 |
</tr> |
| 67 |
</tbody> |
| 68 |
</table> |
| 69 |
</form> |
| 70 |
</div> |