PluginProbe
User Access Manager / 1.2.7.2
User Access Manager v1.2.7.2
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.2.7.2, at tpl/adminSetup.php

148 lines 5.3 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-2016 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 $oUserAccessManager;
18
19 if (isset($_POST['action'])) {
20 $sPostAction = $_POST['action'];
21 } else {
22 $sPostAction = null;
23 }
24
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
63 if (isset($_POST['uam_reset'])) {
64 $sReset = $_POST['uam_reset'];
65 } else {
66 $sReset = null;
67 }
68
69 if ($sReset == 'true') {
70 $oUserAccessManager = new UserAccessManager();
71 $oUserAccessManager->uninstall();
72 $oUserAccessManager->install();
73 ?>
74 <div class="updated">
75 <p><strong><?php echo TXT_UAM_UAM_RESET_SUC; ?></strong></p>
76 </div>
77 <?php
78 }
79 }
80 ?>
81
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>
148 </div>