This commit has been accessed 615 times via Git panel.
commit eb82e00c52a0b4bdd03b399aafa5224fbfd29d42
tree e8a3b95dbb5c11ee311dfb95b2511f452fd37134
parent 24a306a557ea81478fac89fbc191ae3df25a4817
author Magie Antonio <magie@majcms.org> 1314028946 +0800
committer Magie Antonio <magie@majcms.org> 1314028946 +0800
Fix mobile no. bug that prevents user registration
diff --git a/reg.php b/reg.php
index ac3f3ad..ff7d940 100644
--- a/reg.php
+++ b/reg.php
@@ -417,7 +417,7 @@ if ($_POST['submit'] == "1") {
$err_tel = "<td><img src=\"images/widget.ok.png\" border=\"0\" width=\"14\" height=\"14\"></td><td>$tel</td>";
- if (mb_strlen(preg_replace("/[^0-9]/","", $tel)) < 7) {
+ if (file_exists("$maj_data_directory/bb-tel.txt") and (mb_strlen(preg_replace("/[^0-9]/","", $tel)) < 7)) {
$err_reg = $err_reg + 1;
$err_tel = "The mobile number $tel is invalid.";
$err_tel = "<td><img src=\"images/widget.x.png\" border=\"0\" width=\"14\" height=\"14\"></td><td>$err_tel</td>";
@@ -432,7 +432,7 @@ if ($_POST['submit'] == "1") {
else {
$org = trim(strip_tags($_POST['org']));
$org = htmlentities($org, ENT_QUOTES, 'UTF-8');
- $org = ucwords($org);
+ $org = format_title_put($org);
$err_org = "<td><img src=\"images/widget.ok.png\" border=\"0\" width=\"14\" height=\"14\"></td><td>$org</td>";
}
@@ -546,9 +546,9 @@ if ($_POST['submit'] == "1") {
if (file_exists("$maj_data_directory/bb-org.txt") and isset($org) and !empty($org)) {
- $fp_organization_txt = fopen("$maj_data_directory/members/pending/$username/org.txt","w");
- fwrite($fp_organization_txt,$org);
- fclose($fp_organization_txt);
+ $fp_org_txt = fopen("$maj_data_directory/members/pending/$username/org.txt","w");
+ fwrite($fp_org_txt,$org);
+ fclose($fp_org_txt);
}
$bday = $_POST['bd_year'] . $_POST['bd_month'] . $_POST['bd_day'];
@@ -672,7 +672,7 @@ if (file_exists("$maj_data_directory/bb-tel.txt")) {
if (file_exists("$maj_data_directory/bb-org.txt")) {
- echo "<tr><td width=\"100\">Organization</td><td colspan=\"3\"><input required class=\"input\" type=\"text\" autocomplete=\"off\" name=\"org\" maxlength=\"60\"></td>$err_org</tr>";
+ echo "<tr><td width=\"100\">Company or School</td><td colspan=\"3\"><input required class=\"input\" type=\"text\" autocomplete=\"off\" name=\"org\" maxlength=\"60\"></td>$err_org</tr>";
}
?>
tree e8a3b95dbb5c11ee311dfb95b2511f452fd37134
parent 24a306a557ea81478fac89fbc191ae3df25a4817
author Magie Antonio <magie@majcms.org> 1314028946 +0800
committer Magie Antonio <magie@majcms.org> 1314028946 +0800
Fix mobile no. bug that prevents user registration
diff --git a/reg.php b/reg.php
index ac3f3ad..ff7d940 100644
--- a/reg.php
+++ b/reg.php
@@ -417,7 +417,7 @@ if ($_POST['submit'] == "1") {
$err_tel = "<td><img src=\"images/widget.ok.png\" border=\"0\" width=\"14\" height=\"14\"></td><td>$tel</td>";
- if (mb_strlen(preg_replace("/[^0-9]/","", $tel)) < 7) {
+ if (file_exists("$maj_data_directory/bb-tel.txt") and (mb_strlen(preg_replace("/[^0-9]/","", $tel)) < 7)) {
$err_reg = $err_reg + 1;
$err_tel = "The mobile number $tel is invalid.";
$err_tel = "<td><img src=\"images/widget.x.png\" border=\"0\" width=\"14\" height=\"14\"></td><td>$err_tel</td>";
@@ -432,7 +432,7 @@ if ($_POST['submit'] == "1") {
else {
$org = trim(strip_tags($_POST['org']));
$org = htmlentities($org, ENT_QUOTES, 'UTF-8');
- $org = ucwords($org);
+ $org = format_title_put($org);
$err_org = "<td><img src=\"images/widget.ok.png\" border=\"0\" width=\"14\" height=\"14\"></td><td>$org</td>";
}
@@ -546,9 +546,9 @@ if ($_POST['submit'] == "1") {
if (file_exists("$maj_data_directory/bb-org.txt") and isset($org) and !empty($org)) {
- $fp_organization_txt = fopen("$maj_data_directory/members/pending/$username/org.txt","w");
- fwrite($fp_organization_txt,$org);
- fclose($fp_organization_txt);
+ $fp_org_txt = fopen("$maj_data_directory/members/pending/$username/org.txt","w");
+ fwrite($fp_org_txt,$org);
+ fclose($fp_org_txt);
}
$bday = $_POST['bd_year'] . $_POST['bd_month'] . $_POST['bd_day'];
@@ -672,7 +672,7 @@ if (file_exists("$maj_data_directory/bb-tel.txt")) {
if (file_exists("$maj_data_directory/bb-org.txt")) {
- echo "<tr><td width=\"100\">Organization</td><td colspan=\"3\"><input required class=\"input\" type=\"text\" autocomplete=\"off\" name=\"org\" maxlength=\"60\"></td>$err_org</tr>";
+ echo "<tr><td width=\"100\">Company or School</td><td colspan=\"3\"><input required class=\"input\" type=\"text\" autocomplete=\"off\" name=\"org\" maxlength=\"60\"></td>$err_org</tr>";
}
?>