Alternc  latest
Alternc logiel libre pour l'hébergement
mem_param.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Customize the user's interface of AlternC
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 
28 include_once("head.php");
29 
30 $fields = array (
31  "help_setting" => array ("post", "string", ""),
32  "showhelp" => array ("post", "integer", ""),
33 );
34 getFields($fields);
35 
36 
37 if (!empty($help_setting)) {
38  $mem->set_help_param($showhelp);
39  $msg->raise("INFO", "mem", _("Your help setting has been updated."));
40 }
41 
42 ?>
43 <div align="center"><h3><?php __("Settings of your account"); ?></h3></div>
44 <?php
45 
46 $c=$admin->listPasswordPolicies();
47 $passwd_classcount = $c['mem']['classcount'];
48 
49 echo $msg->msg_html_all();
50 ?>
51 
52 <div id="tabsmem">
53 <ul>
54 <li class="hta"><a href="#tabsmem-password"><?php __("Password"); ?></a></li>
55 <li class="mail"><a href="#tabsmem-mail"><?php __("Mail"); ?></a></li>
56 <li class="help"><a href="#tabsmem-help"><?php __("Help"); ?></a></li>
57 <?php
58 if ($mem->user["su"]) { ?>
59 <li class="admin"><a href="#tabsmem-admin"><?php __("Administrator"); ?></a></li> <?php
60 }
61 ?>
62 </ul>
63 
64 <div id="tabsmem-password">
65 <h3><?php __("Password change"); ?></h3>
66 <?php
67 if (!$mem->user["canpass"]) {
68  echo "<p>";
69  __("You cannot change your password");
70  echo "</p>";
71 
72 } else {
73 echo "<p>";
74  __("help_chg_passwd"); ?>
75 </p>
76 <form method="post" action="mem_passwd.php" name="main" id="main" autocomplete="off">
77  <?php csrf_get(); ?>
78 
79 <!-- honeypot fields -->
80 <input type="text" style="display: none" id="fakeUsername" name="fakeUsername" value="" />
81 <input type="password" style="display: none" id="fakePassword" name="fakePassword" value="" />
82 
83 <table border="1" cellspacing="0" cellpadding="4" class="tedit" >
84 <?php if ($mem->requires_old_password_for_change()): ?>
85  <tr><th><?php __("Old password"); ?></th><td><input type="password" class="int" name="oldpass" value="<?php isset($oldpass) ? : $oldpass=""; ehe($oldpass); ?>" size="20" maxlength="128" /></td></tr>
86 <?php endif; ?>
87 <tr><th><?php __("New password"); ?> (1)</th><td><input type="password" class="int" autocomplete="off" id="newpass" name="newpass" value="<?php isset($newpass) ? : $newpass=""; ehe($newpass); ?>" size="20" maxlength="60" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass","#newpass2",$passwd_classcount); ?></td></tr>
88 <tr><th><?php __("New password"); ?> (2)</th><td><input type="password" class="int" autocomplete="off" id="newpass2" name="newpass2" value="<?php isset($newpass2) ? : $newpass2=""; ehe($newpass2);?>" size="20" maxlength="61" /></td></tr>
89 <tr class="trbtn"><td colspan="3"><input type="submit" class="inb ok" name="submit" value="<?php __("Change my password"); ?>" /></td></tr>
90 </table>
91 </form>
92 <br />
93 <?php } ?>
94 </div> <!-- tabsmem-password -->
95 <div id="tabsmem-mail">
96 <h3><?php __("Change the email of the account"); ?></h3>
97 <form method="post" action="mem_chgmail.php">
98  <?php csrf_get(); ?>
99  <table border="1" cellspacing="0" cellpadding="4" class="tedit">
100  <tr><td colspan="2"><?php __("help_chg_mail"); ?></td></tr>
101  <tr><th><?php __("Current mailbox"); ?></th><td><big><code><?php echo $mem->user["mail"]; ?></code></big></td></tr>
102  <tr><th><?php __("New mailbox"); ?></th><td><input type="text" class="int" name="newmail" value="<?php isset($newmail) ? : $newmail=""; ehe($newmail);?>" size="40" maxlength="128" /></td></tr>
103  <tr class="trbtn"><td colspan="3"><input type="submit" class="inb ok" name="submit" value="<?php __("Change my email address"); ?>" /></td></tr>
104  </table>
105 </form>
106 </div> <!-- tabsmem-mail -->
107 <div id="tabsmem-help">
108  <h3><?php __("Online help settings"); ?></h3>
109 <form method="post" action="mem_param.php">
110  <?php csrf_get(); ?>
111  <table border="1" cellspacing="0" cellpadding="4" class="tedit">
112  <tr><td colspan="2"><?php __("help_help_settings"); ?></td></tr>
113  <tr><th><label for="showhelp"><?php __("Do you want to see the help texts and links on each page?"); ?></label></th><td><input type="checkbox" class="inc" id="showhelp" name="showhelp" value="1" <?php if ($mem->get_help_param()) echo "checked=\"checked\""; ?> /></td></tr>
114  <tr class="trbtn"><td colspan="3"><input type="submit" class="inb ok" name="help_setting" value="<?php __("Change these settings"); ?>" /></td></tr>
115  </table>
116 </form>
117 </div> <!-- tabsmem-help -->
118 <?php
119 if ($mem->user["su"]) {
120 ?>
121 <div id="tabsmem-admin">
122 <h3><?php __("Admin preferences"); ?></h3>
123 <form method="post" action="mem_admin.php">
124 <?php csrf_get(); ?>
125 <table border="1" cellspacing="0" cellpadding="4" class="tedit">
126 <tr><th><?php __("Members list view"); ?></th><td><select name="admlist" class="inl">
127 <option value="0"<?php if ($mem->user["admlist"]==0) echo " selected=\"selected\""; ?>><?php __("Large view"); ?></option>
128 <option value="1"<?php if ($mem->user["admlist"]==1) echo " selected=\"selected\""; ?>><?php __("Short view"); ?></option>
129 </select></td></tr>
130 <tr class="trbtn"><td colspan="2"><input type="submit" class="inb ok" name="submit" value="<?php __("Change my admin preferences"); ?>" /></td></tr>
131 </table>
132 </form>
133 </div> <!-- tabsmem-admin -->
134 <?php } ?>
135 
136 </div> <!-- tabsmem -->
137 
138 <script type="text/javascript">
139  if (document.forms['main'].getElementsByClassName("oldpass").length > 0) {
140  document.forms['main'].oldpass.focus();
141  }
142  else {
143  document.getElementById('newpass').focus();
144  }
145  $(function() {$( "#tabsmem" ).tabs();});
146 </script>
147 
148 <?php include_once("foot.php"); ?>
endif
Definition: mem_param.php:86
$fields
Customize the user's interface of AlternC.
Definition: mem_param.php:30
$c
Definition: mem_param.php:46
$passwd_classcount
Definition: mem_param.php:47