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

152 lines 4.8 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 $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 $_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 $_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 <label for="uam_update_db_yes">
120 <input type="radio" id="uam_update_db_yes" class="uam_reset_yes" name="uam_update_db" value="network" />
121 <?php echo TXT_UAM_UPDATE_NETWORK; ?>
122 </label>&nbsp;&nbsp;&nbsp;&nbsp;
123 <?php
124 }
125 ?>
126 <label for="uam_update_db_yes">
127 <input type="radio" id="uam_update_db_yes" class="uam_reset_yes" name="uam_update_db" value="true" />
128 <?php
129 if (is_super_admin()) {
130 echo TXT_UAM_UPDATE_BLOG;
131 } else {
132 echo TXT_UAM_YES;
133 }
134 ?>
135 </label>&nbsp;&nbsp;&nbsp;&nbsp;
136 <label for="uam_update_db_no">
137 <input type="radio" id="uam_update_db_no" class="uam_reset_no" name="uam_update_db" value="false" checked="checked" />
138 <?php echo TXT_UAM_NO; ?>
139 </label>&nbsp;&nbsp;&nbsp;&nbsp;
140 <input type="submit" class="button" name="uam_update_db_submit" value="<?php echo TXT_UAM_UPDATE; ?>" /> <br />
141 <p style="color: red; font-size: 12px; font-weight: bold;">
142 <?php echo TXT_UAM_UPDATE_UAM_DB_DESC; ?>
143 </p>
144 </td>
145 </form>
146 </tr>
147 <?php
148 }
149 ?>
150 </tbody>
151 </table>
152 </div>