This commit has been accessed 706 times via Git panel.
commit de68c2d9438b49c18449bde4a0c7d33919325a97
tree effff82b28108a3b9d0cd6e79e2555a3e6f66a31
parent 3d0ffd758f2b1b53e1bb85ccf8e006c3372a87dd
author Engels Antonio <engels@majcms.org> 1332570591 +0800
committer Engels Antonio <engels@majcms.org> 1332570591 +0800
Enable subscriber name and password change
diff --git a/folders.php b/folders.php
index ee7ffc6..ca7f19e 100644
--- a/folders.php
+++ b/folders.php
@@ -139,4 +139,15 @@ else {
imap_close($mbox);
+echo "<div style=\"height: 4px;\"></div>";
+
+echo "<div class=\"folders\"><table border=\"0\" cellspacing=\"0\" callpadding=\"0\">";
+
+echo "<form method=\"post\">";
+echo "<input type=\"hidden\" name=\"set\" value=\"1\">";
+echo "<tr><td width=\"34\"><input type=\"image\" src=\"images/mail-settings.png\"></td><td>Settings</td></tr>";
+echo "</form>";
+
+echo "</table></div>";
+
?>
diff --git a/images/mail-settings.png b/images/mail-settings.png
new file mode 100644
index 0000000..769d539
Binary files /dev/null and b/images/mail-settings.png differ
diff --git a/index.php b/index.php
index a85a1ae..2a65c53 100644
--- a/index.php
+++ b/index.php
@@ -247,7 +247,7 @@ if (isset($_SESSION['logged_uid'])) {
$usr_name = $usr_data[3];
- if (isset($_POST['usr_name']) and !empty($_POST['usr_name'])) {
+ if (isset($_POST['usr_name']) and !empty($_POST['usr_name']) and (strlen($_POST['usr_name']) <= 128) and (strlen($_POST['usr_name']) > 2)) {
$usr_name = trim($_POST['usr_name']);
$usr_name = ucwords($usr_name);
@@ -270,7 +270,7 @@ if (isset($_SESSION['logged_uid'])) {
$usr_pw0 = $usr_data[1];
- if (isset($_POST['usr_pw1']) and !empty($_POST['usr_pw1']) and isset($_POST['usr_pw2']) and !empty($_POST['usr_pw2']) and isset($_POST['usr_pw3']) and !empty($_POST['usr_pw3'])) {
+ if (isset($_POST['usr_pw1']) and !empty($_POST['usr_pw1']) and isset($_POST['usr_pw2']) and !empty($_POST['usr_pw2']) and isset($_POST['usr_pw3']) and !empty($_POST['usr_pw3']) and (strlen($_POST['usr_pw2']) <= 64) and (strlen($_POST['usr_pw3']) <= 64) and (strlen($_POST['usr_pw2']) >= 8) and (strlen($_POST['usr_pw3']) >= 8)) {
$usr_pw1 = trim($_POST['usr_pw1']);
$usr_pw2 = trim($_POST['usr_pw2']);
@@ -289,6 +289,7 @@ if (isset($_SESSION['logged_uid'])) {
}
else {
ack("password changed");
+ $_SESSION['logged_key'] = $usr_pw2;
}
}
else {
@@ -968,6 +969,34 @@ $pm_now = mysql_num_rows($pm_get);
elseif (isset($_POST['dig']) and !empty($_POST['dig'])) {
include("search.php");
}
+ elseif (isset($_POST['set']) and !empty($_POST['set'])) {
+
+ echo "<title>Kartero - Settings</title>";
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"1\" width=\"800\">";
+ echo "<form method=\"post\">";
+ echo "<input type=\"hidden\" name=\"set\" value=\"1\">";
+ echo "<tr bgcolor=\"#ffffff\"><td width=\"400\"><input class=\"input\" type=\"text\" name=\"usr_name\" value=\"$usr_name\" autocomplete=\"off\" maxlength=\"128\" required autofocus></td><td>name</td></tr>";
+ echo "<tr bgcolor=\"#ffffff\"><td><input class=\"input\" type=\"password\" name=\"usr_pw1\" autocomplete=\"off\" maxlength=\"64\"></td><td>current password</td></tr>";
+
+ echo "<tr bgcolor=\"#ffffff\"><td><input class=\"input\" type=\"password\" name=\"usr_pw2\" autocomplete=\"off\" maxlength=\"64\"></td><td>new password";
+
+ if (isset($_POST['usr_pw1']) and !empty($_POST['usr_pw1']) and isset($_POST['usr_pw2']) and (strlen($_POST['usr_pw2']) < 8)) {
+ echo " <font color=\"red\">too short</font>";
+ }
+
+ echo "</td></tr>";
+
+ echo "<tr bgcolor=\"#ffffff\"><td><input class=\"input\" type=\"password\" name=\"usr_pw3\" autocomplete=\"off\" maxlength=\"64\"></td><td>new password";
+
+ if (isset($_POST['usr_pw1']) and !empty($_POST['usr_pw1']) and isset($_POST['usr_pw3']) and (strlen($_POST['usr_pw3']) < 8)) {
+ echo " <font color=\"red\">too short</font>";
+ }
+
+ echo "</td></tr>";
+
+ echo "<tr bgcolor=\"#ffffff\"><td><input class=\"button\" type=\"submit\" value=\"update\"></td><td></td></tr>";
+ echo "</form></table>";
+ }
else {
include("inbox.php");
@@ -983,18 +1012,7 @@ $pm_now = mysql_num_rows($pm_get);
echo "<td valign=\"top\" width=\"100\">";
include("folders.php");
echo "</td>";
-/*
- echo "<td valign=\"top\" width=\"100\">";
- echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"1\">";
- echo "<form method=\"post\">";
- echo "<tr bgcolor=\"#ffffff\"><td align=\"center\" valign=\"middle\"><img src=\"images/preferences-desktop-personal.png\" border=\"0\" width=\"22\" height=\"22\"></td><td><input class=\"input\" type=\"text\" name=\"usr_name\" value=\"$usr_name\" autocomplete=\"off\" maxlength=\"128\"></td></tr>";
- echo "<tr bgcolor=\"#ffffff\"><td align=\"center\" valign=\"middle\"><img src=\"images/flag-red.png\" border=\"0\" width=\"22\" height=\"22\"></td><td><input class=\"input\" type=\"password\" name=\"usr_pw1\" autocomplete=\"off\" maxlength=\"64\"></td></tr>";
- echo "<tr bgcolor=\"#ffffff\"><td align=\"center\" valign=\"middle\"><img src=\"images/flag-green.png\" border=\"0\" width=\"22\" height=\"22\"></td><td><input class=\"input\" type=\"password\" name=\"usr_pw2\" autocomplete=\"off\" maxlength=\"64\"></td></tr>";
- echo "<tr bgcolor=\"#ffffff\"><td align=\"center\" valign=\"middle\"><img src=\"images/flag-green.png\" border=\"0\" width=\"22\" height=\"22\"></td><td><input class=\"input\" type=\"password\" name=\"usr_pw3\" autocomplete=\"off\" maxlength=\"64\"></td></tr>";
- echo "<tr bgcolor=\"#ffffff\"><td align=\"center\" valign=\"middle\"></td><td><input class=\"button\" type=\"submit\" value=\"update\"></td></tr>";
- echo "</form></table>";
- echo "</td>";
-*/
+
echo "</tr></table>";
}
diff --git a/search.php b/search.php
index ed0546e..ec0032e 100644
--- a/search.php
+++ b/search.php
@@ -24,7 +24,9 @@ if (is_array($search_folders)) {
reset($search_folders);
sort($search_folders);
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr>";
+ echo "<title>Kartero - Search $folder</title>";
+
+ echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"800\"><tr>";
echo "<form method=\"post\">";
echo "<td><select class=\"input\" name=\"box\">";
tree effff82b28108a3b9d0cd6e79e2555a3e6f66a31
parent 3d0ffd758f2b1b53e1bb85ccf8e006c3372a87dd
author Engels Antonio <engels@majcms.org> 1332570591 +0800
committer Engels Antonio <engels@majcms.org> 1332570591 +0800
Enable subscriber name and password change
diff --git a/folders.php b/folders.php
index ee7ffc6..ca7f19e 100644
--- a/folders.php
+++ b/folders.php
@@ -139,4 +139,15 @@ else {
imap_close($mbox);
+echo "<div style=\"height: 4px;\"></div>";
+
+echo "<div class=\"folders\"><table border=\"0\" cellspacing=\"0\" callpadding=\"0\">";
+
+echo "<form method=\"post\">";
+echo "<input type=\"hidden\" name=\"set\" value=\"1\">";
+echo "<tr><td width=\"34\"><input type=\"image\" src=\"images/mail-settings.png\"></td><td>Settings</td></tr>";
+echo "</form>";
+
+echo "</table></div>";
+
?>
diff --git a/images/mail-settings.png b/images/mail-settings.png
new file mode 100644
index 0000000..769d539
Binary files /dev/null and b/images/mail-settings.png differ
diff --git a/index.php b/index.php
index a85a1ae..2a65c53 100644
--- a/index.php
+++ b/index.php
@@ -247,7 +247,7 @@ if (isset($_SESSION['logged_uid'])) {
$usr_name = $usr_data[3];
- if (isset($_POST['usr_name']) and !empty($_POST['usr_name'])) {
+ if (isset($_POST['usr_name']) and !empty($_POST['usr_name']) and (strlen($_POST['usr_name']) <= 128) and (strlen($_POST['usr_name']) > 2)) {
$usr_name = trim($_POST['usr_name']);
$usr_name = ucwords($usr_name);
@@ -270,7 +270,7 @@ if (isset($_SESSION['logged_uid'])) {
$usr_pw0 = $usr_data[1];
- if (isset($_POST['usr_pw1']) and !empty($_POST['usr_pw1']) and isset($_POST['usr_pw2']) and !empty($_POST['usr_pw2']) and isset($_POST['usr_pw3']) and !empty($_POST['usr_pw3'])) {
+ if (isset($_POST['usr_pw1']) and !empty($_POST['usr_pw1']) and isset($_POST['usr_pw2']) and !empty($_POST['usr_pw2']) and isset($_POST['usr_pw3']) and !empty($_POST['usr_pw3']) and (strlen($_POST['usr_pw2']) <= 64) and (strlen($_POST['usr_pw3']) <= 64) and (strlen($_POST['usr_pw2']) >= 8) and (strlen($_POST['usr_pw3']) >= 8)) {
$usr_pw1 = trim($_POST['usr_pw1']);
$usr_pw2 = trim($_POST['usr_pw2']);
@@ -289,6 +289,7 @@ if (isset($_SESSION['logged_uid'])) {
}
else {
ack("password changed");
+ $_SESSION['logged_key'] = $usr_pw2;
}
}
else {
@@ -968,6 +969,34 @@ $pm_now = mysql_num_rows($pm_get);
elseif (isset($_POST['dig']) and !empty($_POST['dig'])) {
include("search.php");
}
+ elseif (isset($_POST['set']) and !empty($_POST['set'])) {
+
+ echo "<title>Kartero - Settings</title>";
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"1\" width=\"800\">";
+ echo "<form method=\"post\">";
+ echo "<input type=\"hidden\" name=\"set\" value=\"1\">";
+ echo "<tr bgcolor=\"#ffffff\"><td width=\"400\"><input class=\"input\" type=\"text\" name=\"usr_name\" value=\"$usr_name\" autocomplete=\"off\" maxlength=\"128\" required autofocus></td><td>name</td></tr>";
+ echo "<tr bgcolor=\"#ffffff\"><td><input class=\"input\" type=\"password\" name=\"usr_pw1\" autocomplete=\"off\" maxlength=\"64\"></td><td>current password</td></tr>";
+
+ echo "<tr bgcolor=\"#ffffff\"><td><input class=\"input\" type=\"password\" name=\"usr_pw2\" autocomplete=\"off\" maxlength=\"64\"></td><td>new password";
+
+ if (isset($_POST['usr_pw1']) and !empty($_POST['usr_pw1']) and isset($_POST['usr_pw2']) and (strlen($_POST['usr_pw2']) < 8)) {
+ echo " <font color=\"red\">too short</font>";
+ }
+
+ echo "</td></tr>";
+
+ echo "<tr bgcolor=\"#ffffff\"><td><input class=\"input\" type=\"password\" name=\"usr_pw3\" autocomplete=\"off\" maxlength=\"64\"></td><td>new password";
+
+ if (isset($_POST['usr_pw1']) and !empty($_POST['usr_pw1']) and isset($_POST['usr_pw3']) and (strlen($_POST['usr_pw3']) < 8)) {
+ echo " <font color=\"red\">too short</font>";
+ }
+
+ echo "</td></tr>";
+
+ echo "<tr bgcolor=\"#ffffff\"><td><input class=\"button\" type=\"submit\" value=\"update\"></td><td></td></tr>";
+ echo "</form></table>";
+ }
else {
include("inbox.php");
@@ -983,18 +1012,7 @@ $pm_now = mysql_num_rows($pm_get);
echo "<td valign=\"top\" width=\"100\">";
include("folders.php");
echo "</td>";
-/*
- echo "<td valign=\"top\" width=\"100\">";
- echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"1\">";
- echo "<form method=\"post\">";
- echo "<tr bgcolor=\"#ffffff\"><td align=\"center\" valign=\"middle\"><img src=\"images/preferences-desktop-personal.png\" border=\"0\" width=\"22\" height=\"22\"></td><td><input class=\"input\" type=\"text\" name=\"usr_name\" value=\"$usr_name\" autocomplete=\"off\" maxlength=\"128\"></td></tr>";
- echo "<tr bgcolor=\"#ffffff\"><td align=\"center\" valign=\"middle\"><img src=\"images/flag-red.png\" border=\"0\" width=\"22\" height=\"22\"></td><td><input class=\"input\" type=\"password\" name=\"usr_pw1\" autocomplete=\"off\" maxlength=\"64\"></td></tr>";
- echo "<tr bgcolor=\"#ffffff\"><td align=\"center\" valign=\"middle\"><img src=\"images/flag-green.png\" border=\"0\" width=\"22\" height=\"22\"></td><td><input class=\"input\" type=\"password\" name=\"usr_pw2\" autocomplete=\"off\" maxlength=\"64\"></td></tr>";
- echo "<tr bgcolor=\"#ffffff\"><td align=\"center\" valign=\"middle\"><img src=\"images/flag-green.png\" border=\"0\" width=\"22\" height=\"22\"></td><td><input class=\"input\" type=\"password\" name=\"usr_pw3\" autocomplete=\"off\" maxlength=\"64\"></td></tr>";
- echo "<tr bgcolor=\"#ffffff\"><td align=\"center\" valign=\"middle\"></td><td><input class=\"button\" type=\"submit\" value=\"update\"></td></tr>";
- echo "</form></table>";
- echo "</td>";
-*/
+
echo "</tr></table>";
}
diff --git a/search.php b/search.php
index ed0546e..ec0032e 100644
--- a/search.php
+++ b/search.php
@@ -24,7 +24,9 @@ if (is_array($search_folders)) {
reset($search_folders);
sort($search_folders);
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr>";
+ echo "<title>Kartero - Search $folder</title>";
+
+ echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"800\"><tr>";
echo "<form method=\"post\">";
echo "<td><select class=\"input\" name=\"box\">";