| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 1 | <?php | 
 | 2 | // Service base url | 
 | 3 | $BASE_URL = "https://example.com/signup"; | 
 | 4 |  | 
| matheusfillipe | 47cf90b | 2021-05-13 03:36:21 -0300 | [diff] [blame] | 5 | // Language country code. The default language to look for. Leave empty for the default html folder | 
 | 6 | $LANG_CC = ""; | 
 | 7 |  | 
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 8 | // Ldap server | 
 | 9 | $HOST = 'localhost'; | 
 | 10 | $PORT = 389; | 
 | 11 | $USER = "admin"; | 
 | 12 | $PASSWORD = "myldappassword"; | 
 | 13 | $BASE_DN = 'cn={},ou=organization,dc=example,dc=com'; | 
 | 14 |  | 
 | 15 | // Redis password | 
 | 16 | $REDIS_PASS = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; | 
 | 17 |  | 
 | 18 | // Mail | 
 | 19 | $SMTP = (object)[ | 
 | 20 |         "from" => 'frommail@mail.com', | 
 | 21 |         'host' => 'tls://mail.com', | 
 | 22 |         'port' => '465', | 
 | 23 |         'username' => 'frommail@mail.com', | 
 | 24 |         'password' => 'xxxxxxxxx' | 
 | 25 | ]; | 
 | 26 | $FALLBACK_SMTP = (object)[ | 
 | 27 |         "from" => 'another@gmail.com', | 
 | 28 |         'host' => 'tls://gmail.com', | 
 | 29 |         'port' => '465', | 
 | 30 |         'username' => 'signup@gmail.com', | 
 | 31 |         'password' => 'xxxxxxxxxx' | 
 | 32 | ]; | 
 | 33 |  | 
 | 34 | // User Validation | 
 | 35 | $VAL_USER = (object)[ | 
 | 36 |         "min_username" => 5, | 
 | 37 |         "max_username" => 32, | 
 | 38 |         "min_first_name" => 3, | 
 | 39 |         "max_first_name" => 32, | 
 | 40 |         "min_last_name" => 3, | 
 | 41 |         "max_last_name" => 32, | 
 | 42 |         "min_password" => 8, | 
 | 43 |         "max_password" => 128 | 
 | 44 | ]; | 
 | 45 | $CAPTCHA_LENGTH = 5; | 
 | 46 |  | 
| matheusfillipe | 38706ea | 2021-05-12 02:45:42 -0300 | [diff] [blame] | 47 | // Use unsafe but easier captcha (no ocr testing) | 
 | 48 | $SIMPLECAPTCHA = false; | 
 | 49 |  | 
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 50 | // not accept emails from | 
 | 51 | $MAIL_HOST_BLACKLIST = ["mailinator.com"]; | 
 | 52 | // Use fallback_smtp directly for these hosts | 
 | 53 | $MAIL_HOST_DIRECT_FALLBACK = ["hotmail.com"]; | 
 | 54 |  | 
 | 55 | // Max registrations from one ip per hour | 
 | 56 | $HOURLY_REGISTRATIONS = 3; | 
 | 57 |  | 
 | 58 | // Max Captcha requests for one  ip per hour | 
 | 59 | $HOURLY_CAPTCHAS = 15; | 
 | 60 |  | 
 | 61 | // Expiration delay for mail confirmation in seconds. After this time the email | 
 | 62 | // confirmation link will say 'token expired' | 
 | 63 | $MAIL_CONFIRMATION_AWAIT_DELAY = 3600; | 
 | 64 |  | 
 | 65 | // CONFIRMATION EMAIL TEMPLATE | 
 | 66 | // text is the version for mail clients that don't support html | 
 | 67 | // html is the version with html support | 
| matheusfillipe | f43dd96 | 2021-05-13 23:27:01 -0300 | [diff] [blame] | 68 | // You can create templaets for different languages under | 
 | 69 | // templates_cc/email.php | 
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 70 | $MAIL_TEMPLATE = (object)[ | 
 | 71 |         "subject" => "Confirm your email",  | 
 | 72 |         "text" => "To complete your registration please paste this to your browser: {{url}}", | 
 | 73 |         "html" => "<html><body> | 
 | 74 |                 <h2>Almost there! Click on the link bellow to confirm your email address</h2> | 
 | 75 |                 <a href='{{url}}'>Confirm</a> | 
 | 76 |         </body></html>" | 
 | 77 | ]; | 
 | 78 |  | 
| Matheus Fillipe | 301684b | 2021-05-14 09:09:43 +0300 | [diff] [blame] | 79 | $RECOVERY_EMAIL_TEMPLATE = (object)[ | 
 | 80 |         "subject" => "Change your password!", | 
 | 81 |         "text"    => "Seems you requested a password change. If that wasn't you please ignore this message. Otherwise go to this url to change your password: {{url}}", | 
 | 82 |         "html"    => "<html><body> | 
 | 83 |                 <h3>Seems you requested a password change. If that wasn't you please ignore this message. Otherwise go to this url to change your password</h3> | 
 | 84 |                 <a href='{{url}}'>Click here</a> to change your password | 
 | 85 |         </body></html>" | 
 | 86 | ]; | 
 | 87 |  | 
 | 88 |  | 
 | 89 | $PASSWORD_CHANGED_EMAIL_TEMPLATE = (object)[ | 
 | 90 |         "subject" => "Your password was changed", | 
 | 91 |         "text"    => "Your password was chanegd successfully. If this wasn't you please contact support", | 
 | 92 |         "html"    => "<html><body> | 
 | 93 |                 <h3>Your password was chanegd successfully. If this wasn't you please contact support</h3> | 
 | 94 |         </body></html>" | 
 | 95 | ]; | 
 | 96 |  | 
| matheusfillipe | 38706ea | 2021-05-12 02:45:42 -0300 | [diff] [blame] | 97 | // url to redirect to after mail confirmation. It will be 5 seconds of delay. Leave empty to none | 
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 98 | $REDIRECT_TO = ""; | 
 | 99 |  | 
| Matheus Fillipe | 5ad0cd5 | 2022-05-05 06:10:41 +0300 | [diff] [blame^] | 100 | // Registration callback. A function to run when registration is successfull | 
 | 101 | $POST_REGISTER_HOOK = function(){ | 
 | 102 |   echo "THE IP: " . $_SERVER['REMOTE_ADDR']; | 
 | 103 | }; | 
 | 104 |  | 
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 105 | // displays php errors on the html page. Set to false for production | 
 | 106 | $DEBUG = false; |