PluginProbe
User Access Manager / 1.2.6.9
User Access Manager v1.2.6.9
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
← All changes | tpl/adminSetup.php +117 -39 1.01.2.6.9 View file →
@@ -8,63 +8,141 @@
8 8 *
9 9 * @category UserAccessManager
10 10 * @package UserAccessManager
11 11 * @author Alexander Schneider <alexanderschneider85@googlemail.com>
12 - * @copyright 2008-2010 Alexander Schneider
12 + * @copyright 2008-2013 Alexander Schneider
13 13 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
14 14 * @version SVN: $Id$
15 15 * @link http://wordpress.org/extend/plugins/user-access-manager/
16 16 */
17 +global $oUserAccessManager;
17 18
18 19 if (isset($_POST['action'])) {
19 - $post_action = $_POST['action'];
20 + $sPostAction = $_POST['action'];
20 21 } else {
21 - $post_action = null;
22 + $sPostAction = null;
22 23 }
23 24
24 -if ($post_action == 'reset_uam') {
25 +if ($sPostAction == 'update_db') {
26 + if (empty($_POST)
27 + || !wp_verify_nonce($_POST['uamSetupUpdateNonce'], 'uamSetupUpdate')
28 + ) {
29 + wp_die(TXT_UAM_NONCE_FAILURE);
30 + }
31 +
32 + if (isset($_POST['uam_update_db'])) {
33 + $sUpdate = $_POST['uam_update_db'];
34 + } else {
35 + $sUpdate = null;
36 + }
37 +
38 + if ($sUpdate == 'true'
39 + || $sUpdate == 'network'
40 + ) {
41 + $mNetwork = false;
42 +
43 + if ($sUpdate == 'network') {
44 + $mNetwork = true;
45 + }
46 +
47 + $oUserAccessManager->update($mNetwork);
48 + ?>
49 + <div class="updated">
50 + <p><strong><?php echo TXT_UAM_UAM_DB_UPDATE_SUC; ?></strong></p>
51 + </div>
52 + <?php
53 + }
54 +}
55 +
56 +if ($sPostAction == 'reset_uam') {
57 + if (empty($_POST)
58 + || !wp_verify_nonce($_POST['uamSetupResetNonce'], 'uamSetupReset')
59 + ) {
60 + wp_die(TXT_UAM_NONCE_FAILURE);
61 + }
62 +
25 63 if (isset($_POST['uam_reset'])) {
26 - $reset = $_POST['uam_reset'];
64 + $sReset = $_POST['uam_reset'];
27 65 } else {
28 - $reset = null;
66 + $sReset = null;
29 67 }
30 68
31 - if ($reset == 'true') {
32 - $userAccessManager = new UserAccessManager();
33 - $userAccessManager->uninstall();
34 - $userAccessManager->install();
69 + if ($sReset == 'true') {
70 + $oUserAccessManager = new UserAccessManager();
71 + $oUserAccessManager->uninstall();
72 + $oUserAccessManager->install();
35 73 ?>
36 - <div class="updated">
37 - <p><strong><?php echo TXT_UAM_RESET_SUC; ?></strong></p>
38 - </div>
74 + <div class="updated">
75 + <p><strong><?php echo TXT_UAM_UAM_RESET_SUC; ?></strong></p>
76 + </div>
39 77 <?php
40 78 }
41 79 }
42 80 ?>
43 81
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>&nbsp;&nbsp;&nbsp;&nbsp;
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>&nbsp;&nbsp;&nbsp;&nbsp;
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>
82 +<div class="wrap">
83 + <h2><?php echo TXT_UAM_SETUP; ?></h2>
84 + <table class="form-table">
85 + <tbody>
86 + <tr valign="top">
87 + <th scope="row"><?php echo TXT_UAM_RESET_UAM; ?></th>
88 + <td>
89 + <form method="post" action="<?php echo htmlspecialchars($_SERVER["REQUEST_URI"]); ?>">
90 + <?php wp_nonce_field('uamSetupReset', 'uamSetupResetNonce'); ?>
91 + <input type="hidden" value="reset_uam" name="action" />
92 + <label for="uam_reset_yes">
93 + <input type="radio" id="uam_reset_yes" class="uam_reset_yes" name="uam_reset" value="true" />
94 + <?php echo TXT_UAM_YES; ?>
95 + </label>&nbsp;&nbsp;&nbsp;&nbsp;
96 + <label for="uam_reset_no">
97 + <input type="radio" id="uam_reset_no" class="uam_reset_no" name="uam_reset" value="false" checked="checked" />
98 + <?php echo TXT_UAM_NO; ?>
99 + </label>&nbsp;&nbsp;&nbsp;&nbsp;
100 + <input type="submit" class="button" name="uam_reset_submit" value="<?php echo TXT_UAM_RESET; ?>" /> <br />
101 + <p style="color: red; font-size: 12px; font-weight: bold;">
102 + <?php echo TXT_UAM_RESET_UAM_DESC; ?>
103 + </p>
104 + </form>
105 + </td>
106 + </tr>
107 + <?php
108 +if ($oUserAccessManager->isDatabaseUpdateNecessary()) {
109 + ?>
110 + <tr valign="top">
111 + <form method="post" action="<?php echo htmlspecialchars($_SERVER["REQUEST_URI"]); ?>">
112 + <?php wp_nonce_field('uamSetupUpdate', 'uamSetupUpdateNonce'); ?>
113 + <input type="hidden" value="update_db" name="action" />
114 + <th scope="row"><?php echo TXT_UAM_UPDATE_UAM_DB; ?></th>
115 + <td>
116 + <?php
117 + if (is_super_admin()) {
118 + ?>
119 + <input type="radio" id="uam_update_db_network" class="uam_reset_yes" name="uam_update_db" value="network" />
120 + <label for="uam_update_db_network"><?php echo TXT_UAM_UPDATE_NETWORK; ?></label>&nbsp;&nbsp;&nbsp;&nbsp;
121 + <?php
122 + }
123 + ?>
124 + <input type="radio" id="uam_update_db_yes" class="uam_reset_yes" name="uam_update_db" value="true" />
125 + <label for="uam_update_db_yes">
126 + <?php
127 + if (is_super_admin()) {
128 + echo TXT_UAM_UPDATE_BLOG;
129 + } else {
130 + echo TXT_UAM_YES;
131 + }
132 + ?>
133 + </label>&nbsp;&nbsp;&nbsp;&nbsp;
134 + <input type="radio" id="uam_update_db_no" class="uam_reset_no" name="uam_update_db" value="false" checked="checked" />
135 + <label for="uam_update_db_no"><?php echo TXT_UAM_NO; ?></label>&nbsp;&nbsp;&nbsp;&nbsp;
136 + <input type="submit" class="button" name="uam_update_db_submit" value="<?php echo TXT_UAM_UPDATE; ?>" /> <br />
137 + <p style="color: red; font-size: 12px; font-weight: bold;">
138 + <?php echo TXT_UAM_UPDATE_UAM_DB_DESC; ?>
139 + </p>
140 + </td>
141 + </form>
142 + </tr>
143 + <?php
144 +}
145 + ?>
146 + </tbody>
147 + </table>
70 148 </div>