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