Skip to content

Commit de32863

Browse files
committed
UserSpice 4.1.1
1 parent aa73adf commit de32863

File tree

7 files changed

+28
-43
lines changed

7 files changed

+28
-43
lines changed

install/install/includes/sql.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ CREATE TABLE `email` (
4545
--
4646

4747
INSERT INTO `email` (`id`, `website_name`, `smtp_server`, `smtp_port`, `email_login`, `email_pass`, `from_name`, `from_email`, `transport`, `verify_url`, `email_act`) VALUES
48-
(1, 'User Spice', 'mail.userspice.com', 587, 'noreply@userspice.com', 'password', 'Your Name', 'noreply@userspice.com', 'Swift_SmtpTransport', 'localhost/us4/users/verify.php', 0);
48+
(1, 'User Spice', 'mail.userspice.com', 587, 'noreply@userspice.com', 'password', 'Your Name', 'noreply@userspice.com', 'tls', 'http://localhost/us4/', 0);
4949

5050
-- --------------------------------------------------------
5151

users/email_settings.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
$query = $db->query("SELECT * FROM email");
3030
$results = $query->first();
3131

32+
$urlProtocol=isset($_SERVER['HTTPS']) ? 'https://' : 'http://';
33+
34+
3235
if(!empty($_POST)){
3336
$token = $_POST['csrf'];
3437
if(!Token::check($token)){
@@ -124,7 +127,9 @@
124127

125128
<h1>Setup your email server</h1>
126129
<p>
127-
These settings control all things email-related for the server including emailing your users and verifying the user's email address.
130+
These settings control all things email-related for the server including emailing your users and verifying the user's email address.
131+
You must obtain and verify all settings below for YOUR email server or hosting provider. Encryption with TLS is STRONGLY recommended,
132+
followed by SSL. No encryption is like shouting your login credentials out into a crowded field and is not supported for now.
128133
</p>
129134
</p>It is <strong>HIGHLY</strong> recommended that you test your email settings before turning on the feature to require new users to verify their email<br>
130135
<a href="email_test.php" class="btn btn-danger">Test Your Settings</a><br><br>
@@ -152,12 +157,14 @@
152157
<input required size='50' class='form-control' type='text' name='from_email' value='<?=$results->from_email?>' />
153158

154159
<label>Transport (Experimental):</label>
155-
<input required size='50' class='form-control' type='text' name='transport' value='<?=$results->transport?>' />
160+
<select class="form-control" name="transport">
161+
<option value="tls" <?php if($results->transport=='tls') echo 'selected="selected"'; ?> >TLS (encrypted)</option>
162+
<option value="ssl" <?php if($results->transport=='ssl') echo 'selected="selected"'; ?> >SSL (encrypted, but weak)</option>
163+
</select>
156164

157-
<label>URL of YOUR verify.php file: (VERY Important). <?="Default location would be: ".$_SERVER['HTTP_HOST'].$us_url_root.'users/verify.php'?></label>
165+
<label>Root URL of your UserSpice install including http or https protocol (VERY Important) <br/><div class="text-muted"> <?="Default location would be: ".$urlProtocol.$_SERVER['HTTP_HOST'].$us_url_root?></div></label>
158166
<input required size='50' class='form-control' type='text' name='verify_url' value='<?=$results->verify_url?>' />
159167

160-
161168
<label>Require User to Verify Their Email?:</label>
162169
<input type="radio" name="email_act" value="1" <?php echo ($results->email_act==1)?'checked':''; ?> size="25">Yes</input>
163170
<input type="radio" name="email_act" value="0" <?php echo ($results->email_act==0)?'checked':''; ?> size="25">No</input>

users/helpers/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function email($to,$subject,$body,$attachment=false){
117117
$mail->SMTPAuth = true; // Enable SMTP authentication
118118
$mail->Username = $smtp_username; // SMTP username
119119
$mail->Password = $smtp_password; // SMTP password
120-
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
120+
$mail->SMTPSecure = $smtp_transport; // Enable TLS encryption, `ssl` also accepted
121121
$mail->Port = $smtp_port; // TCP port to connect to
122122

123123
$mail->setFrom($from, $from_name);

users/includes/user_spice_ver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
2-
$user_spice_ver="Version 4.1.0";
2+
$user_spice_ver="Version 4.1.1";
33
?>

users/views/_email_template_forgot_password.php

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
11
<?php
2-
$abs_us_root=$_SERVER['DOCUMENT_ROOT'];
3-
4-
$self_path=explode("/", $_SERVER['PHP_SELF']);
5-
$self_path_length=count($self_path);
6-
$file_found=FALSE;
7-
8-
for($i = 1; $i < $self_path_length; $i++){
9-
array_splice($self_path, $self_path_length-$i, $i);
10-
$us_url_root=implode("/",$self_path)."/";
11-
12-
if (file_exists($abs_us_root.$us_url_root.'z_us_root.php')){
13-
$file_found=TRUE;
14-
break;
15-
}else{
16-
$file_found=FALSE;
17-
}
18-
}
2+
$db = DB::getInstance();
3+
$query = $db->query("SELECT * FROM email");
4+
$results = $query->first();
195
?>
206
<!DOCTYPE html>
217
<html>
@@ -26,7 +12,7 @@
2612
<p>Hello <?=$fname;?>,</p>
2713
<p>You are receiving this email because a request was made to reset your password. If this was not you, you may disgard this email.</p>
2814
<p>If this was you, click the link below to continue with the password reset process.</p>
29-
<p><a href="<?=$_SERVER['HTTP_HOST'].$us_url_root?>users/forgot_password_reset.php?email=<?=$email;?>&vericode=<?=$vericode;?>&reset=1">Reset Password</a></p>
15+
<p><a href="<?=$results->verify_url?>users/forgot_password_reset.php?email=<?=$email;?>&vericode=<?=$vericode;?>&reset=1">Reset Password</a></p>
3016
<p>Sincerely,</p>
3117
<p>-The Team-</p>
3218
</body>

users/views/_email_template_verify.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<body>
1313
<p>Congratulations <?=$fname;?>,</p>
1414
<p>Thanks for signing up Please click the link below to verify your email address.</p>
15-
<p><a href="<?=$results->verify_url?>?email=<?=$email;?>&vericode=<?=$vericode;?>">Verify Your Email</a></p>
15+
<p><a href="<?=$results->verify_url?>users/verify.php?email=<?=$email;?>&vericode=<?=$vericode;?>">Verify Your Email</a></p>
1616
<p>Once you verify your email address you will be ready to login!</p>
1717
<p>See you soon!</p>
1818
</body>

users/views/_join.php

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,29 @@
3434
<label for="username">Choose a Username</label>
3535
<input class="form-control" type="text" name="username" id="username" placeholder="Username" value="<?php if (!$form_valid && !empty($_POST)){ echo $username;} ?>" required autofocus>
3636
<p class="help-block">No Spaces or Special Characters - Min 5 characters</p>
37-
</div>
38-
<div class="form-group">
37+
3938
<label for="fname">First Name</label>
4039
<input type="text" class="form-control" id="fname" name="fname" placeholder="First Name" value="<?php if (!$form_valid && !empty($_POST)){ echo $fname;} ?>" required>
41-
</div>
42-
<div class="form-group">
40+
4341
<label for="lname">Last Name</label>
4442
<input type="text" class="form-control" id="lname" name="lname" placeholder="Last Name" value="<?php if (!$form_valid && !empty($_POST)){ echo $lname;} ?>" required>
45-
</div>
46-
<div class="form-group">
43+
4744
<label for="email">Email Address</label>
4845
<input class="form-control" type="text" name="email" id="email" placeholder="Email Address" value="<?php if (!$form_valid && !empty($_POST)){ echo $email;} ?>" required >
49-
</div>
50-
<div class="form-group">
46+
5147
<label for="company">Company Name</label>
5248
<input type="text" class="form-control" id="company" name="company" placeholder="Company Name" value="<?php if (!$form_valid && !empty($_POST)){ echo $company;} ?>">
53-
</div>
54-
<div class="form-group">
49+
5550
<label for="password">Choose a Password</label>
5651
<input class="form-control" type="password" name="password" id="password" placeholder="Password" required aria-describedby="passwordhelp">
5752
<span class="help-block" id="passwordhelp">Must be at least 6 characters</span>
58-
</div>
59-
<div class="form-group">
53+
6054
<label for="confirm">Confirm Password</label>
6155
<input type="password" id="confirm" name="confirm" class="form-control" placeholder="Confirm Password" required >
62-
</div>
63-
<div class="form-group">
56+
6457
<label for="confirm">Registration User Terms and Conditions</label>
65-
<textarea id="agreement" name="agreement" rows="5" class="form-control" disabled ><?php require '../usersc/includes/user_agreement.php'; ?></textarea>
66-
</div>
67-
<div class="form-group">
58+
<textarea id="agreement" name="agreement" rows="5" class="form-control" disabled ><?php require $abs_us_root.$us_url_root.'usersc/includes/user_agreement.php'; ?></textarea>
59+
6860
<label for="confirm">Check box to agree to terms</label>
6961
<input type="checkbox" id="agreement_checkbox" name="agreement_checkbox" class="form-control">
7062
</div>

0 commit comments

Comments
 (0)