Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
irhosseinz committed Jun 13, 2020
1 parent 28947a2 commit c55771e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions install/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@
PRIMARY KEY (`_id`),
KEY `email` (`email`)
) ENGINE=InnoDB;");
if($ok){
while($DB->next_result()){;}
}else{
$ERROR="there was an error while creating tables: ".$DB->error;
}
$password=UM_randomString(8);
if($_SESSION['email_admin'] && $DB->query("INSERT INTO users set email_temp='{$_SESSION['email_admin']}',password='".UM_PASSWORD($password)."'")){
if($_SESSION['email_admin'] && $DB->query("INSERT INTO users set email='{$_SESSION['email_admin']}',password='".UM_PASSWORD($password)."'")){
$_SESSION['UM_ADMIN']=array($_SESSION['email_admin'],$password);
}
$rules=array();
Expand Down Expand Up @@ -134,7 +139,7 @@
header('Location: finish.php');
$DB->close();
exit;
}else{
}else if(!$ERROR){
$ERROR="there was an error! please check includes/config.php file permission. (make it 777) ".$DB->error;
}
}
Expand Down
4 changes: 2 additions & 2 deletions install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
$("#form").validate({
focusInvalid: false,onkeyup: false,
errorClass: "is-invalid",validClass: "is-valid",
rules:{domain:{url:true},email:{email:true}}
rules:{domain:{url:true},email:{email:true}},
submitHandler: function(form) {
form.submit();
}
Expand Down Expand Up @@ -107,7 +107,7 @@
<label class="form-check-label" for="referral">
Activate Referral System
</label>
</div>
</div><br/><br/>
<div class="form-group">
<label for="input_captcha1">If you want Recaptcha to be used for login and Registration and.. get a <a href="https://www.google.com/recaptcha/admin" target="_blank">Recaptcha V3</a> and enter it here. (Don't forget to add your domain there!)</label>
<input type="text" class="form-control" name="captcha1" required id="input_captcha1" placeholder="SITE KEY"/>
Expand Down
4 changes: 2 additions & 2 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$ERROR='ARE YOU A BOT??';
}else{
$_POST['forget']=strtolower($_POST['forget']);
$st=$DB->prepare("select * from users where email=? or email_temp=? order by email!=? limit 1");
$st=$DB->prepare("select * from users where email=? or email_temp=? order by email is null,email!=? limit 1");
$st->bind_param('sss',$_POST['forget'],$_POST['forget'],$_POST['forget']);
if($st->execute() && $r=$st->get_result()->fetch_assoc()){
$st=$DB->prepare("insert into verify set user_id=?,email=?,secret=?,action=?");
Expand Down Expand Up @@ -45,7 +45,7 @@
$_POST['email']=strtolower($_POST['email']);
$e=",expire=TIMESTAMPADD(DAY,".(UM_LOGIN_EXPIRE>0?UM_LOGIN_EXPIRE:365).",NOW())";
$p=UM_randomString(rand(30,40));
$st=$DB->prepare("select * from users where email=? or email_temp=? order by email!=? limit 1");
$st=$DB->prepare("select * from users where email=? or email_temp=? order by email is null,email!=? limit 1");
$st->bind_param('sss',$_POST['email'],$_POST['email'],$_POST['email']);
if($st->execute()){
$data=$st->get_result()->fetch_assoc();
Expand Down

0 comments on commit c55771e

Please sign in to comment.