]> jfr.im git - irc/UndernetIRC/cservice-web.git/commitdiff
Use the defined LIVE_LOCATION setting to generate correct URLs
authorStefan Wold <redacted>
Sat, 23 Jan 2021 12:06:32 +0000 (12:06 +0000)
committerStefan Wold <redacted>
Sat, 23 Jan 2021 12:06:32 +0000 (12:06 +0000)
17 files changed:
composer.lock
docker-entrypoint.sh
docs/gnuworld/admin/view_pendingusers.php
docs/gnuworld/complaints/confirm.php
docs/gnuworld/complaints/record.php
docs/gnuworld/complaints/ticket.php
docs/gnuworld/cr_newuser.php
docs/gnuworld/forms/confirm_emailchange.php
docs/gnuworld/forms/confirm_mgrchange.php
docs/gnuworld/forms/emailchange.php
docs/gnuworld/forms/managerchange.php
docs/gnuworld/forms/pwreset.php
docs/gnuworld/new_newusers.php
docs/gnuworld/newuser.php
docs/gnuworld/nu [deleted file]
docs/gnuworld/totp/activate.php
docs/gnuworld/view_app.php

index 7768661859d05284d103fb2e2e4271d1f150f0dc..6447cdec04386425f06d9ef25ebd58c8cbb61562 100644 (file)
@@ -8,16 +8,16 @@
     "packages": [
         {
             "name": "monolog/monolog",
-            "version": "1.25.4",
+            "version": "1.26.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Seldaek/monolog.git",
-                "reference": "3022efff205e2448b560c833c6fbbf91c3139168"
+                "reference": "2209ddd84e7ef1256b7af205d0717fb62cfc9c33"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Seldaek/monolog/zipball/3022efff205e2448b560c833c6fbbf91c3139168",
-                "reference": "3022efff205e2448b560c833c6fbbf91c3139168",
+                "url": "https://api.github.com/repos/Seldaek/monolog/zipball/2209ddd84e7ef1256b7af205d0717fb62cfc9c33",
+                "reference": "2209ddd84e7ef1256b7af205d0717fb62cfc9c33",
                 "shasum": ""
             },
             "require": {
@@ -33,7 +33,7 @@
                 "graylog2/gelf-php": "~1.0",
                 "php-amqplib/php-amqplib": "~2.4",
                 "php-console/php-console": "^3.1.3",
-                "php-parallel-lint/php-parallel-lint": "^1.0",
+                "phpstan/phpstan": "^0.12.59",
                 "phpunit/phpunit": "~4.5",
                 "ruflin/elastica": ">=0.90 <3.0",
                 "sentry/sentry": "^0.13",
                 "sentry/sentry": "Allow sending log messages to a Sentry server"
             },
             "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "2.0.x-dev"
-                }
-            },
             "autoload": {
                 "psr-4": {
                     "Monolog\\": "src/Monolog"
@@ -81,7 +76,7 @@
                 "logging",
                 "psr-3"
             ],
-            "time": "2020-05-22T07:31:27+00:00"
+            "time": "2020-12-14T12:56:38+00:00"
         },
         {
             "name": "psr/log",
index 5e0d8796bf24e04650efeef31068b40af97ed107..2847acb301ad0b1dba4a56815cf771c0c903010c 100755 (executable)
@@ -24,6 +24,7 @@ if [ "$1" == "httpd" ]; then
     sed "/^die/d" /app/php_includes/config.inc.dist > /app/php_includes/config.inc
     sed -i '/STD_THEME/s;default;unetnew;' /app/php_includes/config.inc
     sed -i '/FONT_PATH/s;\.\.\.;/app/fonts;' /app/php_includes/config.inc
+    sed -i '/LIVE_LOCATION/s;/live;;' /app/php_includes/config.inc
   fi
   if [ ! -f "/app/php_includes/blackhole.inc" ]; then
     cp "/app/php_includes/blackhole.inc.dist" "/app/php_includes/blackhole.inc"
index 71468d5e7bd5473ffe83d0dc1ca7def25599cc10..ad1e1f975c617fd7eb3205871a4049ee4a14fbc5 100755 (executable)
@@ -25,7 +25,7 @@
  echo "<b>" . $s1->count . "</b> total user(s) pending.";
  echo "<br><br>";
  echo "<i>";
- $confirm_url = gen_server_url() . substr( $REQUEST_URI,0,strrpos( substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")),"/")) . "/confirm.php";
+ $confirm_url = gen_server_url() . LIVE_LOCATION . "/confirm.php";
  echo "Pending users are *NOT* yet active on the system, they wait the user confirmation by clicking on the email they received,<br>\n";
  echo "or by going on <a href=\"" . $confirm_url . "\">" . $confirm_url . "</a> and by entering the given cookie.<br>\n";
  echo "Pending users expire <b>24 hours</b> after the request was posted.";
index 495ae320e4c186e6b2ffa68d0b287266575e01d0..5109febadf737da0b0585789d941741a906a6966 100755 (executable)
@@ -18,11 +18,11 @@ if (!$r) { echo "<h2>Invalid ID</h2>"; } else {
                echo "Your complaint has been placed in the work queue and will be processed as soon as possible.<br><br>\n";
                echo "Please allow 3-5 days for processing, You will be re-contacted by e-mail.<br></h3><br><h4><br>\n";
                echo "Your ticket number is <b>" . $ticket_number . "</b>, you can see the status of your complaint by going to :<br>\n";
-               $status_url = gen_server_url() . substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")) . "/status.php";
+               $status_url = gen_server_url() . LIVE_LOCATION . "/complaints/status.php";
                $added_url_s = "?ID=" . $ticket_number;
                echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"status.php" . $added_url_s . "\">" . $status_url . $added_url_s . "</a><br><br>\n";
                echo "You can ABANDON / CLOSE your complaint by going to :<br>\n";
-               $close_url = gen_server_url() . substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")) . "/ticket.php";
+               $close_url = gen_server_url() . LIVE_LOCATION . "/complaints/ticket.php";
                $added_url_c = "?A=close&ID=" . $ticket_number . "&C=" . md5( CRC_SALT_0005 . $ticket_number . "close" );
                echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"ticket.php" . $added_url_c . "\">" . $close_url . $added_url_c . "</a><br><br>\n";
                echo "The " . NETWORK_NAME . " Channel Service Complaint Department Team.<br><br></h4>\n";
index 6f214938b44244e2be93db1dd7ae3377f122b98b..c7dd3ea996e9efc0fd85ecd49f975b4e1995f80c 100755 (executable)
@@ -334,7 +334,7 @@ if (!$res) { die($back_lnk . "<b>SQL ERROR</b><br><br></td></tr></table></body><
        $mmsg .= "We recently received a complaint to CService using this e-mail address (" . $_POST["from_mail"] . ") for the reply.\n";
        $mmsg .= "If you haven't sent any complaint and don't know what this is all about, then just delete this message and DO NOT CLICK below.\n\n";
        $mmsg .= "If you are the person that sent that complaint, please confirm it by clicking the link below within 48 hours :\n\n";
-       $confirm_url = gen_server_url() . substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")) . "/confirm.php";
+       $confirm_url = gen_server_url() . LIVE_LOCATION . "/complaints/confirm.php";
        $mmsg .= "\t\t" . $confirm_url . "?ID=" . $da_crc . "\n\n";
        $mmsg .= "\nThe " . NETWORK_NAME . " Channel Service.\n\n";
        custom_mail($_POST["from_mail"],"[" . NETWORK_NAME . " CService Complaints] Confirmation request",$mmsg,"From: " . NETWORK_NAME . " Channel Service <" . OBJECT_EMAIL . ">\nReply-to: DO.NOT@REPLY.THANKS\nX-Mailer: " . NETWORK_NAME . " CService Complaint Module\n\n");
index 1bbbf92bfd97c03aaee34ce413c227d92df845d3..c08f2a92eae3114d9e41570d504905633095a5ae 100755 (executable)
@@ -268,7 +268,7 @@ switch ($_GET["A"]) {
                                                        $mm .= "You'll receive a confirmation right after this message.\n\n";
                                                } else {
                                                        $mm .= "You can reply to this message by following the next link :\n";
-                                                       $da_url = gen_server_url() . substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")) . "/ticket.php?A=reply&ID=" . $_GET["ID"] . "&C=" . md5( CRC_SALT_0005 . $_GET["ID"] . $da_rt . "reply-user" ) ."&RT=" . $da_rt;
+                                                       $da_url = gen_server_url() . LIVE_LOCATION . "/complaints/ticket.php?A=reply&ID=" . $_GET["ID"] . "&C=" . md5( CRC_SALT_0005 . $_GET["ID"] . $da_rt . "reply-user" ) ."&RT=" . $da_rt;
                                                        $mm .= $da_url . "\n\n";
                                                }
                                                custom_mail($daobj->from_email,"[" . NETWORK_NAME . " CService Complaints] " . $_GET["ID"] . " - Admin Reply",$mm,"From: " . NETWORK_NAME . " Channel Service <" . OBJECT_EMAIL . ">\nReply-to: DO.NOT@REPLY.THANKS\nX-Mailer: " . NETWORK_NAME . " CService Complaint Module\n\n");
index ce3ce697984ff509c1e705354b381c3186796d6a..de6e89b2e79452113f6bc3128987887dea917eaa 100755 (executable)
@@ -10,7 +10,7 @@ $cTheme = get_theme_info();
        }
 
 
-       $confirm_url = gen_server_url() . substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")) . "/confirm.php";
+$confirm_url = gen_server_url() . LIVE_LOCATION . "/confirm.php";
 
 //
 $lowusername = strtolower( $username ); // lower case pgsql cares
index 0c96b61309e080f04bb10bf7af6f09fac0705cc0..bff51c7d380d3e62e86ecb59314aaabdde650292 100755 (executable)
@@ -41,7 +41,7 @@ $user=pg_fetch_object($res,0);
         $cookieval = md5(CRC_SALT_0020 . uniqid("",1) . time() . $nmail);
        pg_safe_exec("update pending_emailchanges SET expiration=(now()::abstime::int4+21600),phase=2,cookie='$cookieval' WHERE phase=1 AND cookie='$ID'");
 
-        $confirm_url = gen_server_url() . substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")) . "/confirm_emailchange2.php?ID=$cookieval";
+        $confirm_url = gen_server_url() . LIVE_LOCATION . "/forms/confirm_emailchange2.php?ID=$cookieval";
 
         $the_msg = "If you would like to confirm that the new email-in-record for '".$user->user_name."' should be '$nmail',\n";
         $the_msg .= "then click on the link below within 6 hours :\n\n";
index af37dcbec4f24a6253a531a0c28846f7c4f89a15..f3a226ddcc867997e9509ac4198dc786abab0483 100755 (executable)
@@ -9,6 +9,8 @@ if($loadavg5 >= (2*CRIT_LOADAVG))
 
 $cTheme = get_theme_info();
 
+echo "WTF " . gen_server_url();
+
 /* $Id: confirm_mgrchange.php,v 1.6 2003/01/17 05:47:16 nighty Exp $ */
 
 if ($ID!="" && strlen($ID)<=128) {
index 31d6cec7ac83e9e579438a055afe1d27c5cc9637..944c71a0cda6be4716629b35b70787948a348fe8 100755 (executable)
@@ -148,7 +148,7 @@ if ($verifdata!=$user->verificationdata) {
        $cookieval = md5(CRC_SALT_0020 . uniqid("",1) . time() . $da_newmail);
 
        pg_safe_exec("INSERT INTO pending_emailchanges (cookie,user_id,old_email,new_email,expiration,phase) VALUES ('$cookieval',$user_id,'$da_emailaddy','$da_newmail',now()::abstime::int4+21600,1)");
-       $confirm_url = gen_server_url() . substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")) . "/confirm_emailchange.php?ID=$cookieval";
+       $confirm_url = gen_server_url() . LIVE_LOCATION. "/forms/confirm_emailchange.php?ID=$cookieval";
 
        $the_msg = "If you would like to confirm that the new email-in-record for '$da_username' should be '$da_newmail',\n";
        $the_msg .= "then click on the link below within 6 hours :\n\n";
index 8ca2531407c6b85f196251131f852eaeeaa09d37..025029acc0ad9165c8ae5d921739e5ffc06977cf 100755 (executable)
@@ -377,7 +377,7 @@ if (pg_numrows($huhu)>0) {
        }
        $mmsg .= "to user '$newmgr->user_name' who is a level 499 on " . str_replace("\\'","'",$channel) . ",\n\n";
        $mmsg .= "then click on the following link to confirm (say YES) within SIX HOURS, after that it will be too late :\n\n";
-       $mmsg .= "\t" . gen_server_url() . substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")) . "/confirm_mgrchange.php?ID=$crc_cookie\n\n";
+       $mmsg .= "\t" . gen_server_url() . LIVE_LOCATION . "/forms/confirm_mgrchange.php?ID=$crc_cookie\n\n";
        $mmsg .= "if you dont want this request to be processed, just IGNORE this mail and DO NOT click on the above URL.\n\n\n";
        $mmsg .= "The " . NETWORK_NAME . " Channel Service.\n\n";
 
index 31086bcb4c51276068e48dd15bc0ca1122cbf114..d7aa14be54b697d8d3f0b01d2de0df42f51b0316 100755 (executable)
@@ -119,12 +119,8 @@ if ($ro1->post_forms!="" && $ro1->post_forms>0) {
        }
 }
 
-$temp = $REQUEST_URI;
-$tpos = strrpos($temp,"/");
-$tpos2 = strrpos(substr($temp,0,$tpos),"/");
-$turl = substr($temp,0,$tpos2+1);
-$tref = gen_server_url() . $turl . "forgotten_pass.php";
-$tref2 = gen_server_url() . $REQUEST_URI;
+$tref = gen_server_url() . LIVE_LOCATION . "/forgotten_pass.php";
+$tref2 = gen_server_url() . $_SERVER['REQUEST_URI'];
 $_SERVER['HTTP_REFERER']=str_replace("https", "http", $_SERVER['HTTP_REFERER']);
 $tref=str_replace("https", "http", $tref);
 $tref2=str_replace("https", "http", $tref2);
@@ -253,7 +249,7 @@ if ($crc == md5($HTTP_USER_AGENT . $ts . CRC_SALT_0009)) {
 
        $cookieval = md5(CRC_SALT_0015 . uniqid("",1) . time() . $da_emailaddy . $verifdata);
        pg_safe_exec("INSERT INTO pending_pwreset (cookie,user_id,question_id,verificationdata,expiration) VALUES ('$cookieval',$uid,'$verifq','$verifdata',now()::abstime::int4+21600)");
-       $confirm_url = gen_server_url() . substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")) . "/confirm_pwreset.php?ID=$cookieval";
+       $confirm_url = gen_server_url() . LIVE_LOCATION . "/forms/confirm_pwreset.php?ID=$cookieval";
        $the_msg = "If you would like to confirm that the new verification question/answer for '$da_username' should be changed as requested,\n";
        $the_msg .= "then click on the link below within 6 hours :\n\n";
        $the_msg .= "\t$confirm_url\n\n\nThank you\n" . NETWORK_NAME . " Channel Service\n\n\nPS- Please do *NOT* reply to this mail.";
index a2752aa2abaf1370059bd370304eebc144e758a4..427610825d260bbe717eca1c7e809ca545b4f80c 100755 (executable)
@@ -10,7 +10,7 @@ std_connect();
 $cTheme = get_theme_info();
 $user_id = std_security_chk($_COOKIE["auth"]);
 $admin = 0;
-$confirm_url = gen_server_url() . substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")) . "/confirm.php";
+$confirm_url = gen_server_url() . LIVE_LOCATION . "/confirm.php";
 
 // check for global lock (admin)
 if (newusers_off()) {
index d18471d3b68605faca7600e993657dfe6a219da4..09ea03beef6e172fc9458083eebd88103343661f 100755 (executable)
@@ -9,7 +9,7 @@ std_connect();
 $cTheme = get_theme_info();
 $user_id = std_security_chk($_COOKIE["auth"]);
 $admin = 0;
-$confirm_url = gen_server_url() . substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")) . "/confirm.php";
+$confirm_url = gen_server_url() . LIVE_LOCATION . "/confirm.php";
 
 // check for global lock (admin)
 if (newusers_off()) {
diff --git a/docs/gnuworld/nu b/docs/gnuworld/nu
deleted file mode 100755 (executable)
index b145d91..0000000
+++ /dev/null
@@ -1,350 +0,0 @@
-<?php
-/* $Id: newuser.php,v 1.28 2005/11/18 04:19:33 nighty Exp $ */
-require("../../php_includes/blackhole.inc");
-require("../../php_includes/cmaster.inc");
-if($loadavg5 >= CRIT_LOADAVG) { header("Location: highload.php"); die; }
-
-std_connect();
-$cTheme = get_theme_info();
-$user_id = std_security_chk($_COOKIE["auth"]);
-$admin = 0;
-$confirm_url = gen_server_url() . substr($REQUEST_URI,0,strrpos($REQUEST_URI,"/")) . "/confirm.php";
-
-// check for global lock (admin)
-if (newusers_off()) {
-       echo "<html><head><title>PAGE LOCKED BY CSERVICE ADMINISTRATORS</title>";
-       std_theme_styles();
-       echo "</head>\n";
-       std_theme_body();
-       echo "<center>\n";
-       echo "<h2>";
-       echo "Sorry, You can't register new users at the moment.";
-       echo "</h2>";
-       echo "</center>\n";
-       echo "</body></html>\n\n";
-       die;
-}
-if (NEWUSERS_IPCHECK && !newu_ipcheck(0)) {
-       echo "<html><head><title>SECURITY WARNING</title>";
-       std_theme_styles();
-       echo "</head>\n";
-       std_theme_body();
-       echo "<center>\n";
-       echo "<h2>";
-       echo "Sorry, your IP address already registered a username, you can only register ONE username.";
-       echo "</h2>";
-       echo "</center>\n";
-       echo "</body></html>\n\n";
-       die;
-}
-
-// check if the client is already authenticated (!)
-if ($user_id > 0) {
-       std_theme_styles(1);
-       std_theme_body();
-       echo "<p>You are already logged in.  You are not allowed to create multiple accounts.</p>";
-       echo "<p>Go to your <a href=\"./\" target=\"_top\">user page</a>.</p></body></html>";
-       die;
-}
-
-unset($max_step); unset($curr_step);
-$max_step = 6;
-if (SHOW_GFXUSRCHK && NEWUSERS_GFXCHECK) { $max_step++; }
-if ((int)$_POST["showStep"]>0 && check_secure_form("step".(int)$_POST["showStep"])) { $curr_step = (int)$_POST["showStep"]; } else { $curr_step = 1; }
-if (!(SHOW_GFXUSRCHK && NEWUSERS_GFXCHECK) && $curr_step==6) { $curr_step = 7; }
-
-if ($curr_step==8) {
-       if ($_POST["rCRC"]==md5( $_POST["username"] . CRC_SALT_0011 . $_SERVER["REMOTE_ADDR"] . $_POST["email"] . $_POST["gfxcode_val"] . CRC_SALT_0007 )) {
-               // sets cookie so user cannot create another username within 4 hours.
-               if (UNETUB_TIME>0) {
-                       $expire = time()+UNETUB_TIME;
-                       $cookie = md5( $expire . "Undernet User Block");
-                       setcookie("UNETUB",$cookie,$expire,"/");
-               }
-       }
-}
-
-std_theme_styles(1);
-std_theme_body();
-
-echo "<form name=newUsr method=POST onSubmit=\"return stepChk(this)\">\n";
-echo "<input type=hidden name=showStep value=\"" . (int)((int)$curr_step+1) . "\">\n";
-make_secure_form("step".(int)((int)$curr_step+1));
-echo "<center>";
-
-echo "<h1>New Username</h1>";
-
-echo "<table width=500 bgcolor=#" . $cTheme->main_textcolor . "><tr><td>\n";
-echo "<table cellpadding=5 bgcolor=#" . $cTheme->table_bgcolor . " width=100%><tr><td><font color=#" . $cTheme->main_textcolor . ">";
-if ($curr_step<=7) {
-       echo "<font size=+2>Step " . (int)$curr_step . " / " . (int)$max_step . "</font><br><br>\n";
-} else {
-       echo "<font size=+2>Congratulations !</font><br><br>\n";
-}
-
-// step data START
-$jsf = "";
-$err = "";
-
-switch ((int)$curr_step) {
-       default:
-       case 1:
-               echo "The Children's Online Privacy Protection Act of 1998 (COPPA) requires that web page publishers obtain parental ";
-               echo "consent before asking for or using personal information from children under 13. Because " . NETWORK_NAME . " cannot comply ";
-               echo "with this requirement, we must have you state by clicking this box that you are at least 13 years old.<br><br>\n";
-               echo "<input type=radio name=user_age id=ua1 value=1>&nbsp;<label for=ua1>I am 13 or older.</label><br>\n";
-               echo "<input type=radio name=user_age id=ua2 value=0>&nbsp;<label for=ua2>I am younger than 13.</label><br>\n";
-               $jsf .= "\tif (!f.user_age[0].checked) { all_ok = false; }\n";
-               $jsf .= "\tvar msg = 'You must specify that you are 13 or older !';\n";
-               break;
-       case 2:
-               if ((int)$_POST["user_age"]!=1) { $err .= "<li> You must be 13 or older.\n"; }
-               if ($err!="") { err_newuser($err); } else {
-                       echo "<input type=hidden name=is13 value=1>\n";
-
-                       echo "Choose a username.  This is how you are known to the channel service bots. ";
-                       echo "This does <em>not</em> need to be the same as your nick. A valid username ";
-                       echo "is made up of the letters 'A' to 'Z' and the numbers '0' to '9'. THIS IS NOT NICK REGISTRATION. YOU ";
-                       echo "ARE NOT REGISTERING YOUR NICKNAME. Can we possibly make it clearer that this is NOT NICK REGISTRATION. ";
-                       echo "If you refer to it as nick registration, do not be surprised if we don't know what you are talking about.<br><br>\n";
-                       echo "<label>Username: <input type=text name=username maxlength=12>\n";
-                       $jsf .= "\tif (f.username.value.length < 3) { all_ok = false; }\n";
-                       $jsf .= "\tvar msg = 'Your username must be 2 to 12 letters long !';\n";
-               }
-               break;
-       case 3:
-               if (strlen($_POST["username"])<3 || strlen($_POST["username"])>12) { $err .= "<li> Your username must be 2 to 12 chars long.\n"; }
-               if (!preg_match("/^[A-Za-z0-9]+$/",$_POST["username"])) { $err .= "<li> Your username must be made of letters (A-Z, a-z) and numbers (0-9).\n"; }
-               $ru = pg_safe_exec("SELECT id FROM users WHERE lower(user_name)='" . strtolower($_POST["username"]) . "'");
-               if ($ou=@pg_fetch_object($ru)) { $err .= "<li> The username you picked is already in use by someone else.\n"; }
-               if (is_locked_username($_POST["username"])) { $err .= "<li> Username is LOCKED : Usernames matching <b>" . $ulockinfo->user_name . "</b> are disallowed for the following reason : <b>" . $ulockinfo->reason . "</b>.\n"; }
-               $res = pg_safe_exec("SELECT * FROM noreg WHERE lower(user_name)='" . post2db(strtolower($_POST["username"])) . "'");
-               if (pg_numrows($res)>0) { $err .= "<li> That username (" . $_POST["username"] . ") is in NOREG mode, please choose another.\n"; }
-               if ($err!="") { err_newuser($err); } else {
-                       echo "<input type=hidden name=is13 value=1>\n";
-                       echo "<input type=hidden name=username value=\"" . post2input($_POST["username"]) . "\">\n";
-
-                       echo "Please enter your primary email address. Use your ISP email address where possible. Your email address will never be used ";
-                       echo "to send you unsolicited email.  It will be used to send you information on how to obtain your ";
-                       echo "password.<br><br>\n";
-                       echo "<label>Email Address: <input type=text name=email maxlength=128>\n";
-                       $jsf .= "\tif (f.email.value == '') { all_ok = false; }\n";
-                       $jsf .= "\tvar msg = 'Please type in your e-mail address !';\n";
-               }
-               break;
-       case 4:
-               if (!is_email_valid($_POST["email"])) { $err .= "<li> Your e-mail address is invalid.\n"; }
-               if (is_email_locked($LOCK_USERNAME,$_POST["email"])) { $err .= "<li> You are not allowed to create an account using this email address (" . $_POST["email"] . ")\n"; }
-               $email_nreg = pg_safe_exec("SELECT * FROM noreg WHERE lower(email)='" . post2db(strtolower($_POST["email"])) . "' and user_name='*'");
-               if (pg_numrows($email_nreg)>0) { $err .= "<li> This email account (" . $_POST["email"] . ") is in NOREG, you can't use it for username registration.\n"; }
-               $email_dbh = pg_safe_exec("SELECT user_name FROM users WHERE lower(email)='" . post2db(strtolower($_POST["email"])) . "'");
-               if (pg_numrows($email_dbh)>0) { $err .= "<li> There is already an account registered with that email address.<br>You can only have one account per person. If you have lost your password and require a new one to be resent <a href=\"forgotten_pass.php\">click here</a>.\n"; }
-               if ($err!="") { err_newuser($err); } else {
-                       echo "<input type=hidden name=is13 value=1>\n";
-                       echo "<input type=hidden name=username value=\"" . post2input($_POST["username"]) . "\">\n";
-                       echo "<input type=hidden name=email value=\"" . post2input($_POST["email"]) . "\">\n";
-
-                       echo "Select your preferred language for CService's " . BOT_NAME . " bot to communicate with you on IRC. ";
-                       echo "Note that all functions are not supported in all languages. ";
-                       echo "If we cannot communicate with your in your language of choice, we will ";
-                       echo "use English.<br><br>\n";
-                       echo "<label>Language: <select name=language>\n";
-                       $res=pg_safe_exec("select * from languages ORDER by name");
-                       for ($i=0;$i<pg_numrows($res);$i++) {
-                               $lang=pg_fetch_object($res,$i);
-                               echo "<option ";
-                               if ($lang->id==1) { echo "selected "; }
-                               echo "value=\"" . $lang->id . "\">" . $lang->name . "</option>\n";
-                       }
-                       echo "</select>\n";
-               }
-               break;
-       case 5:
-               if ($err!="") { err_newuser($err); } else {
-                       echo "<input type=hidden name=is13 value=1>\n";
-                       echo "<input type=hidden name=username value=\"" . post2input($_POST["username"]) . "\">\n";
-                       echo "<input type=hidden name=email value=\"" . post2input($_POST["email"]) . "\">\n";
-                       echo "<input type=hidden name=language value=\"" . post2input($_POST["language"]) . "\">\n";
-
-                       echo "<p>Select a question and give an answer that you will remember. This information will be used as additional verification if you forget your password or need to change your email-of-record.</p>\n";
-                       echo "<select name=question_id>\n";
-                       echo "<option selected value=0>--- click here ---</option>\n";
-                       for ($x=1;$x<=$max_question_id;$x++) {
-                               echo "<option value=" . $x;
-                               if( $x == $question_id ) {
-                                       echo( " selected" );
-                               }
-                               echo ">" . $question_text[$x] . "</option>\n";
-                       }
-                       echo "</select><br>\n";
-                       echo "<input type=text size=25 maxlength=30 name=verificationdata>\n";
-                       $jsf .= "\tif (f.question_id.options[f.question_id.selectedIndex].value == 0) { all_ok = false; }\n";
-                       $jsf .= "\tif (f.verificationdata.value.length < 4) { all_ok = false; }\n";
-                       $jsf .= "\tvar msg = 'Please pick a question and fill in the answer for it (4 chars minimum) !';\n";
-               }
-               break;
-       case 6:
-               if ((int)$_POST["question_id"]<=0 || (int)$_POST["question_id"]>$max_question_id) { $err .= "<li> Please select a question.\n"; }
-               if (strlen($_POST["verificationdata"])<4) { $err .= "<li> Please choose an answer with at least 4 chars in it.\n"; }
-               if(!(preg_match( "/^[A-Za-z0-9!\ \/\\.+_-]+$/", $_POST["verificationdata"] ))) { $err .= "<li> The entered verification data contains invalid chars.\n"; }
-               if (strtolower($_POST["email"])==strtolower($_POST["verificationdata"])) { $err .= "<li> Your verification answer must be different than your email.\n"; }
-               if (strtolower($_POST["username"])==strtolower($_POST["verificationdata"])) { $err .= "<li> Your verification answer must be different than your username.\n"; }
-               if (is_locked_va($_POST["verificationdata"])) { $err .= "<li> The verification answer you have chosen is too common. Please pick an answer that is unique and that you will remember.\n"; }
-               if ($err!="") { err_newuser($err); } else {
-                       echo "<input type=hidden name=is13 value=1>\n";
-                       echo "<input type=hidden name=username value=\"" . post2input($_POST["username"]) . "\">\n";
-                       echo "<input type=hidden name=email value=\"" . post2input($_POST["email"]) . "\">\n";
-                       echo "<input type=hidden name=language value=\"" . post2input($_POST["language"]) . "\">\n";
-                       echo "<input type=hidden name=question_id value=\"" . post2input($_POST["question_id"]) . "\">\n";
-                       echo "<input type=hidden name=verificationdata value=\"" . post2input($_POST["verificationdata"]) . "\">\n";
-
-                       // generate the code to enter and the CRC to check it after post.
-                       // this solution will hopefully prevent any automated username registration procedure.
-                       $code_length = 10; // generated code number of chars
-                       $code_base = md5( CRC_SALT_0001 . time() . microtime() . CRC_SALT_0009 . uniqid(1) ); // base of code ( with strlen(this)>$code_length ! ).
-                       $code = strtoupper(substr(str_replace("1","",str_replace("i","",str_replace("I","",str_replace("o","",str_replace("O","",str_replace("l","",str_replace("L","",str_replace("0","",$code_base)))))))),0,$code_length));
-                       $ts = time()+180; // expires 3 mins after page load.
-                       $crckey = md5( $ts . $_SERVER["HTTP_USER_AGENT"] . $_SERVER["REMOTE_ADDR"] . CRC_SALT_0010 . $code . CRC_SALT_0008 );
-                       echo "<input type=hidden name=gfxcode_crc value=\"" . $crckey . "\">\n";
-                       echo "<input type=hidden name=gfxcode_ts value=\"" . $ts . "\">\n";
-                       $ENABLE_COOKIE_TABLE = 1;
-                       pg_safe_exec("INSERT INTO gfxcodes VALUES ('" . $code . "','" . $crckey . "','" . $ts . "')");
-                       $ENABLE_COOKIE_TABLE = 0;
-                       echo "<img src=\"gfx_code.php?crc=" . $crckey . "\" border=0 alt=\"TYPE THAT CODE IN THE INPUT BOX BELOW\"><br>\n";
-                       echo "<p>Now please enter the code you see in the above picture into the below input box (upper/lower case doesn't matter).</p>\n";
-                       echo "<input type=text size=35 maxlength=" . $code_length . " name=gfxcode_val value=\"\">\n";
-                       $jsf .= "\tif (f.gfxcode_val.value == '') { all_ok = false; }\n";
-                       $jsf .= "\tvar msg = 'Please fill in the CODE !';\n";
-               }
-               break;
-       case 7:
-               if (SHOW_GFXUSRCHK && NEWUSERS_GFXCHECK) {
-                       // check GFX code
-                       if ($_POST["gfxcode_crc"] != md5( $_POST["gfxcode_ts"] . $_SERVER["HTTP_USER_AGENT"] . $_SERVER["REMOTE_ADDR"] . CRC_SALT_0010 . strtoupper($_POST["gfxcode_val"]) . CRC_SALT_0008)) {
-                               $err .= "<li> You entered an invalid code from the picture.\n";
-                       } else { // CRC logic is fine, now check with the database temporary record...
-                               $ENABLE_COOKIE_TABLE = 1;
-                               pg_safe_exec("DELETE FROM gfxcodes WHERE expire<now()::abstime::int4");
-                               $r = pg_safe_exec("SELECT expire FROM gfxcodes WHERE crc='" . $gfxcode_crc . "' AND code='" . strtoupper($gfxcode_val) . "'");
-                               if (pg_numrows($r)==0) {
-                                       $err .= "<li> You entered an invalid/expired code from the picture.\n";
-                               } else {
-                                       pg_freeresult($r);
-                               }
-                               $ENABLE_COOKIE_TABLE = 0;
-                       }
-               } else {
-                       // check step5 (see step6)
-                       if ((int)$_POST["question_id"]<=0 || (int)$_POST["question_id"]>$max_question_id) { $err .= "<li> Please select a question.\n"; }
-                       if (strlen($_POST["verificationdata"])<4) { $err .= "<li> Please choose an answer with at least 4 chars in it.\n"; }
-                       if(!(preg_match( "/^[A-Za-z0-9!\ \/\\.+_-]+$/", $_POST["verificationdata"] ))) { $err .= "<li> The entered verification data contains invalid chars.\n"; }
-                       if (strtolower($_POST["email"])==strtolower($_POST["verificationdata"])) { $err .= "<li> Your verification answer must be different than your email.\n"; }
-                       if (strtolower($_POST["username"])==strtolower($_POST["verificationdata"])) { $err .= "<li> Your verification answer must be different than your username.\n"; }
-                       if (is_locked_va($_POST["verificationdata"])) { $err .= "<li> The verification answer you have chosen is too common. Please pick an answer that is unique and that you will remember.\n"; }
-               }
-               if ($err!="") { err_newuser($err); } else {
-                       echo "<input type=hidden name=is13 value=1>\n";
-                       echo "<input type=hidden name=username value=\"" . post2input($_POST["username"]) . "\">\n";
-                       echo "<input type=hidden name=email value=\"" . post2input($_POST["email"]) . "\">\n";
-                       echo "<input type=hidden name=language value=\"" . post2input($_POST["language"]) . "\">\n";
-                       echo "<input type=hidden name=question_id value=\"" . post2input($_POST["question_id"]) . "\">\n";
-                       echo "<input type=hidden name=verificationdata value=\"" . post2input($_POST["verificationdata"]) . "\">\n";
-                       echo "<input type=hidden name=gfxcode_crc value=\"" . post2input($_POST["gfxcode_crc"]) . "\">\n";
-                       echo "<input type=hidden name=gfxcode_ts value=\"" . post2input($_POST["gfxcode_ts"]) . "\">\n";
-                       echo "<input type=hidden name=gfxcode_val value=\"" . post2input($_POST["gfxcode_val"]) . "\">\n";
-                       echo "<input type=hidden name=ipaddr value=\"" . $_SERVER["REMOTE_ADDR"] . "\">\n";
-                       echo "<input type=hidden name=rCRC value=\"" . md5( $_POST["username"] . CRC_SALT_0011 . $_SERVER["REMOTE_ADDR"] . $_POST["email"] . $_POST["gfxcode_val"] . CRC_SALT_0007 ) . "\">\n";
-
-                       echo "<p>Individuals are granted the use of a Channel Service username specifically to gain access to channel services. ";
-                       echo "While you need not use channel services to have a username, be aware that attempts to register multiple usernames to ";
-                       echo "the same person will result in a suspension of all the offending names. ";
-                       echo "Don't jeopardize your access to channel services by trying to register multiple usernames on our system.<br>\n";
-                       echo "Applying for a username while connected from a compromised computer is not allowed.</p>\n";
-                       echo "<p>Now click 'Submit' to finish your application.</p>\n";
-               }
-               break;
-       case 8: // final POST
-               if ($_POST["rCRC"]==md5( $_POST["username"] . CRC_SALT_0011 . $_SERVER["REMOTE_ADDR"] . $_POST["email"] . $_POST["gfxcode_val"] . CRC_SALT_0007 )) {
-                       $ENABLE_COOKIE_TABLE = 1;
-                       pg_safe_exec("DELETE FROM gfxcodes WHERE crc='" . post2db($_POST["gfxcode_crc"]) . "' AND code='" . post2db(strtoupper($_POST["gfxcode_val"])) . "'");
-                       $ENABLE_COOKIE_TABLE = 0;
-                       // checks if cookie disallowing new username is present.
-                       if ($_COOKIE["UNETUB"]!="" && UNETUB_TIME>0) {
-                               err_newuser("Your IP has already registered a username, you can only signup for ONE username."); $err = 1;
-                       } elseif (NEWUSERS_IPCHECK && !newu_ipcheck(1)) {
-                               err_newuser("Your IP has already registered a username, you can only signup for ONE username."); $err = 1;
-                       } else {
-                               $cookie=md5(microtime() . time() . CRC_SALT_0003 . $_POST["username"] . $_POST["email"]);
-                               $expire=time()+86400; // 1 day
-                               $language = (int)$_POST["language"];
-                               // Run any user typed field that hasn't already been sanity checked through the prepare_dbtext() function.
-                               $verificationdata = post2db($_POST["verificationdata"]);
-                               pg_safe_exec("insert into pendingusers (user_name,cookie,expire,email,language,question_id,verificationdata,poster_ip) values ('" . post2db($_POST["username"]) . "','" . post2db($cookie) . "'," . (int)$expire . ",'" . post2db(strtolower($_POST["email"])) . "'," . $language . "," . (int)$question_id . ",'" . $verificationdata . "','" . cl_ip() . "')");
-                               $boundary=md5(time());
-                               custom_mail($_POST["email"],$mail_subject_new,"To continue the registration process go to " . $confirm_url . "?cookie=" . $cookie,
-                                       "From: " . $mail_from_new . "\nReply-To: " . $mail_from_new . "\nX-Mailer: " . NETWORK_NAME . " Channel Service"
-                               );
-                               echo("<p>Your registration email has been sent.  Please wait to receive it, and then follow the instructions it contains to continue</p>");
-                       }
-               } else {
-                       err_newuser("Ooops! Something went wrong, please try again !"); $err = 1;
-               }
-               break;
-
-}
-
-if ($err == "") {
-       if ((int)$curr_step<7) {
-               echo "<p align=right><input type=submit value=\"NEXT &gt;&gt;\"></p>\n";
-       } else {
-               echo "<p align=right><input type=submit value=\"SUBMIT\"></p>\n";
-       }
-<<<<<<< newuser.php
-       $cookie=md5(microtime() . time() . CRC_SALT_0003 . $username . $email);
-       $expire=time()+86400; // 1 day
-       $language = intval( $language ); // Force int
-       // Run any user typed field that hasn't already been sanity checked through the prepare_dbtext() function.
-       $verificationdata = prepare_dbtext( $verificationdata );
-       local_seclog("New user request for `" . $username . "`");
-       pg_safe_exec("insert into pendingusers (user_name,cookie,expire,email,language,question_id,verificationdata,poster_ip) values ('$username','$cookie',$expire,'$lowemail',$language,$question_id,'$verificationdata','" . cl_ip() . "')");
-       $boundary=md5(time());
-       custom_mail($email,$mail_subject_new,"To continue the registration process go to $confirm_url?cookie=$cookie",
-               "From: $mail_from_new\nReply-To: $mail_from_new\nX-Mailer: " . NETWORK_NAME . " Channel Service"
-       );
-
-       // sets cookie so user cannot create another username within 4 hours.
-       if (UNETUB_TIME>0) {
-               $expire = time()+UNETUB_TIME;
-               $cookie = md5( $expire . "Undernet User Block");
-               setcookie("UNETUB",$cookie,$expire,"/");
-       }
-       if ($first_error) { std_theme_styles(1); std_theme_body(); $first_error=0; }
-       echo("<p>Your registration email has been sent.  Please wait to receive it, and then follow the instructions it contains to continue</p>");
-       exit;
-=======
-} else {
-       echo "<p align=center><input type=button value=\"GO BACK\" onClick=\"history.go(-1)\"></p>\n";
->>>>>>> 1.28
-}
-
-// step data END
-
-echo "<script language=\"JavaScript\">\n";
-echo "<!--\n";
-echo "function stepChk(f) {\n";
-echo "\tvar all_ok = true;\n";
-echo $jsf;
-echo "\tif (!all_ok) { alert(msg); }\n";
-echo "\treturn all_ok;\n";
-echo "}\n";
-echo "//-->\n";
-echo "</script>\n";
-
-echo "\t</td></tr></table>\n";
-echo "</td></tr></table>\n";
-echo "<br>\n";
-
-?>
-</form>
-</body>
-</html>
index 34cb3944482b6e281d77ab34eb35dd64a05c259c..0b7f3c0a95221be30b64f287b03cf901497a462b 100755 (executable)
@@ -69,8 +69,8 @@ if ($mode=="write" && $crc == md5( $SECURE_ID . CRC_SALT_0011 )) {
        pg_safe_exec($query);
        $mailm = "";
        $mailm .= "\nHello,\n\nThis is a confirmation that you have chosen to enable two-step verification,\nto complete the activation follow the instructions below.\n\n";
-    preg_match('/(.+)\/totp.*/', $REQUEST_URI, $m);
-       $confirm_url = gen_server_url() . preg_replace('/\/totp.*/','', $REQUEST_URI) ."/main.php?entotp=1&ID=$cookieval";
+    preg_match('/(.+)\/totp.*/', $_SERVER['REQUEST_URI'], $m);
+       $confirm_url = gen_server_url() . LIVE_LOCATION ."/main.php?entotp=1&ID=$cookieval";
        $mailm .= "Make sure that you are logged in to the CService webpage, then click on this link ".$confirm_url." and follow the instructions.\n\n";
        $mailm .= "\n\nThe " . NETWORK_NAME . " Channel Service.\n\n";
        custom_mail($dauser->email,"CService enable two-step verification",$mailm,"From: " . NETWORK_NAME . " Channel Service <" . FROM_NEWUSER . ">\nReply-to: " . OBJECT_EMAIL . "\nX-Mailer: " . NETWORK_NAME . " Channel Service\n\n");
index 8c34eb623d4efea447417de0d497fdcf3ab8ce78..85e8cf4e2d9213ba3fe9d55d11de093ea29337e5 100755 (executable)
                                echo "<br>";
                                echo "<script language=\"JavaScript1.2\">\n<!--\n";
                                echo "function admintracker() {\n";
-                               echo "\tmyurl = 'app_tracker.php?APPID=" . $id . "&RETURL=" . urlencode($REQUEST_URI) . "';\n";
+                               echo "\tmyurl = 'app_tracker.php?APPID=" . $id . "&RETURL=" . urlencode($_SERVER['REQUEST_URI']) . "';\n";
                                echo "\tpopwin = open(myurl,'AppTracker','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=250,height=500');\n";
                                echo "\tpopwin.focus();\n";
                                echo "}\n";
        }
        echo "<tr><td valign=center align=right><u>Current status :</u>&nbsp;</td><td valign=center><font size=+2><b><font color=" . $status_color . ">" . $status_msg . "</font></b></font></td></tr>\n";
        $backlink2 = $backlink;
-       if ($backlink2=="list_app.php") { $backlink2 =  gen_server_url() . $REQUEST_URI; }
+       if ($backlink2=="list_app.php") { $backlink2 =  gen_server_url() . $_SERVER['REQUEST_URI']; }
        if (REQUIRED_SUPPORTERS>0 && $nrw_lvl>0) {
                echo "<tr><td valign=center align=right><font color=#ff0000><b>*</b></font>&nbsp;<u>Review :</u>&nbsp;</td><td valign=center><font size=+1><b>";
                if ($ptable->reviewed=="Y") {
                        echo "<tr><td colspan=2 valign=center align=center>\n";
                        echo "<br><br><br>\n";
                        echo "You must be <b>logged in</b> in order to post objections<br><br>\n";
-                       echo "<a href=\"login.php?redir=" . urlencode($REQUEST_URI) . "\" target=\"_top\">Click here to log in</a>\n";
+                       echo "<a href=\"login.php?redir=" . urlencode($_SERVER['REQUEST_URI']) . "\" target=\"_top\">Click here to log in</a>\n";
                        echo "<br><br><br>\n";
                        echo "</td></tr>\n";
                }