PluginProbe
User Access Manager / 1.1
User Access Manager v1.1
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
user-access-manager / tpl / adminSetup.php

adminSetup.php in User Access Manager 1.1, at tpl/adminSetup.php

114 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 global $userAccessManager;
18
19 if (isset($_POST['action'])) {
20 $postAction = $_POST['action'];
21 } else {
22 $postAction = null;
23 }
24
25 if ($postAction == 'update_db') {
26 if (isset($_POST['uam_update_db'])) {
27 $update = $_POST['uam_update_db'];
28 } else {
29 $update = null;
30 }
31
32 if ($update == 'true') {
33 $userAccessManager->update();
34 ?>
35 <div class="updated">
36 <p><strong><?php echo TXT_UAM_DB_UPDATE_SUC; ?></strong></p>
37 </div>
38 <?php
39 }
40 }
41
42 if ($postAction == 'reset_uam') {
43 if (isset($_POST['uam_reset'])) {
44 $reset = $_POST['uam_reset'];
45 } else {
46 $reset = null;
47 }
48
49 if ($reset == 'true') {
50 $userAccessManager = new UserAccessManager();
51 $userAccessManager->uninstall();
52 $userAccessManager->install();
53 ?>
54 <div class="updated">
55 <p><strong><?php echo TXT_UAM_RESET_SUC; ?></strong></p>
56 </div>
57 <?php
58 }
59 }
60 ?>
61
62 <div class="wrap">
63 <h2><?php echo TXT_SETUP; ?></h2>
64 <table class="form-table">
65 <tbody>
66 <tr valign="top">
67 <th scope="row"><?php echo TXT_RESET_UAM; ?></th>
68 <td>
69 <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
70 <input type="hidden" value="reset_uam" name="action" />
71 <label for="uam_reset_yes">
72 <input type="radio" id="uam_reset_yes" class="uam_reset_yes" name="uam_reset" value="true" />
73 <?php echo TXT_YES; ?>
74 </label>&nbsp;&nbsp;&nbsp;&nbsp;
75 <label for="uam_reset_no">
76 <input type="radio" id="uam_reset_no" class="uam_reset_no" name="uam_reset" value="false" checked="checked" />
77 <?php echo TXT_NO; ?>
78 </label>&nbsp;&nbsp;&nbsp;&nbsp;
79 <input type="submit" class="button" name="uam_reset_submit" value="<?php echo TXT_RESET; ?>" /> <br />
80 <p style="color: red; font-size: 12px; font-weight: bold;">
81 <?php echo TXT_RESET_UAM_DESC; ?>
82 </p>
83 </form>
84 </td>
85 </tr>
86 <?php
87 if ($userAccessManager->isDatabaseUpdateNecessary()) {
88 ?>
89 <tr valign="top">
90 <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
91 <input type="hidden" value="update_db" name="action" />
92 <th scope="row"><?php echo TXT_UPDATE_UAM_DB; ?></th>
93 <td>
94 <label for="uam_update_db_yes">
95 <input type="radio" id="uam_update_db_yes" class="uam_reset_yes" name="uam_update_db" value="true" />
96 <?php echo TXT_YES; ?>
97 </label>&nbsp;&nbsp;&nbsp;&nbsp;
98 <label for="uam_update_db_no">
99 <input type="radio" id="uam_update_db_no" class="uam_reset_no" name="uam_update_db" value="false" checked="checked" />
100 <?php echo TXT_NO; ?>
101 </label>&nbsp;&nbsp;&nbsp;&nbsp;
102 <input type="submit" class="button" name="uam_update_db_submit" value="<?php echo TXT_UPDATE; ?>" /> <br />
103 <p style="color: red; font-size: 12px; font-weight: bold;">
104 <?php echo TXT_UPDATE_UAM_DB_DESC; ?>
105 </p>
106 </td>
107 </form>
108 </tr>
109 <?php
110 }
111 ?>
112 </tbody>
113 </table>
114 </div>