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

138 lines 4.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-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 || $update == 'network'
34 ) {
35 $network = false;
36
37 if ($update == 'network') {
38 $network = true;
39 }
40
41 $userAccessManager->update($network);
42 ?>
43 <div class="updated">
44 <p><strong><?php echo TXT_UAM_UAM_DB_UPDATE_SUC; ?></strong></p>
45 </div>
46 <?php
47 }
48 }
49
50 if ($postAction == 'reset_uam') {
51 if (isset($_POST['uam_reset'])) {
52 $reset = $_POST['uam_reset'];
53 } else {
54 $reset = null;
55 }
56
57 if ($reset == 'true') {
58 $userAccessManager = new UserAccessManager();
59 $userAccessManager->uninstall();
60 $userAccessManager->install();
61 ?>
62 <div class="updated">
63 <p><strong><?php echo TXT_UAM_UAM_RESET_SUC; ?></strong></p>
64 </div>
65 <?php
66 }
67 }
68 ?>
69
70 <div class="wrap">
71 <h2><?php echo TXT_UAM_SETUP; ?></h2>
72 <table class="form-table">
73 <tbody>
74 <tr valign="top">
75 <th scope="row"><?php echo TXT_UAM_RESET_UAM; ?></th>
76 <td>
77 <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
78 <input type="hidden" value="reset_uam" name="action" />
79 <label for="uam_reset_yes">
80 <input type="radio" id="uam_reset_yes" class="uam_reset_yes" name="uam_reset" value="true" />
81 <?php echo TXT_UAM_YES; ?>
82 </label>&nbsp;&nbsp;&nbsp;&nbsp;
83 <label for="uam_reset_no">
84 <input type="radio" id="uam_reset_no" class="uam_reset_no" name="uam_reset" value="false" checked="checked" />
85 <?php echo TXT_UAM_NO; ?>
86 </label>&nbsp;&nbsp;&nbsp;&nbsp;
87 <input type="submit" class="button" name="uam_reset_submit" value="<?php echo TXT_UAM_RESET; ?>" /> <br />
88 <p style="color: red; font-size: 12px; font-weight: bold;">
89 <?php echo TXT_UAM_RESET_UAM_DESC; ?>
90 </p>
91 </form>
92 </td>
93 </tr>
94 <?php
95 if ($userAccessManager->isDatabaseUpdateNecessary()) {
96 ?>
97 <tr valign="top">
98 <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
99 <input type="hidden" value="update_db" name="action" />
100 <th scope="row"><?php echo TXT_UAM_UPDATE_UAM_DB; ?></th>
101 <td>
102 <?php
103 if (is_super_admin()) {
104 ?>
105 <label for="uam_update_db_yes">
106 <input type="radio" id="uam_update_db_yes" class="uam_reset_yes" name="uam_update_db" value="network" />
107 <?php echo TXT_UAM_UPDATE_NETWORK; ?>
108 </label>&nbsp;&nbsp;&nbsp;&nbsp;
109 <?php
110 }
111 ?>
112 <label for="uam_update_db_yes">
113 <input type="radio" id="uam_update_db_yes" class="uam_reset_yes" name="uam_update_db" value="true" />
114 <?php
115 if (is_super_admin()) {
116 echo TXT_UAM_UPDATE_BLOG;
117 } else {
118 echo TXT_UAM_YES;
119 }
120 ?>
121 </label>&nbsp;&nbsp;&nbsp;&nbsp;
122 <label for="uam_update_db_no">
123 <input type="radio" id="uam_update_db_no" class="uam_reset_no" name="uam_update_db" value="false" checked="checked" />
124 <?php echo TXT_UAM_NO; ?>
125 </label>&nbsp;&nbsp;&nbsp;&nbsp;
126 <input type="submit" class="button" name="uam_update_db_submit" value="<?php echo TXT_UAM_UPDATE; ?>" /> <br />
127 <p style="color: red; font-size: 12px; font-weight: bold;">
128 <?php echo TXT_UAM_UPDATE_UAM_DB_DESC; ?>
129 </p>
130 </td>
131 </form>
132 </tr>
133 <?php
134 }
135 ?>
136 </tbody>
137 </table>
138 </div>