@@ -97,7 +97,7 @@ public function toggle()
9797 $ stmt ->bind_param ("i " , $ this ->id );
9898 $ stmt ->execute ();
9999 $ stmt ->close ();
100- header ("Location: " .WEB_URL ."/admin/?do=user& id= " .$ id );
100+ header ("Location: " .WEB_URL ."/admin/?do=user&id= " .$ id );
101101 }else {
102102 $ message = _ ("You don't have the permission to do that! " );
103103 }
@@ -317,14 +317,14 @@ public function render_user_settings()
317317 <div class="col-md-2 col-md-offset-2"><strong><?php echo _ ("Username " );?> </strong></div>
318318 <div class="col-md-6"><?php echo $ this ->username ." " ; if ($ this ->id !=$ _SESSION ['user ' ] && $ user ->get_rank ()<=1 && ($ user ->get_rank ()<$ this ->rank ))
319319 {
320- echo "<a href=' " .WEB_URL ."/admin/?do=user& id= " .$ this ->id ."& what=toggle'> " ;
320+ echo "<a href=' " .WEB_URL ."/admin/?do=user&id= " .$ this ->id ."&what=toggle'> " ;
321321 echo "<i class='fa fa- " .($ this ->active ?"check success " :"times danger " )."'></i></a> " ;
322322 }else {
323323 echo "<i class='fa fa- " .($ this ->active ?"check success " :"times danger " )."'></i> " ;
324324 }?> </div>
325325 </div>
326326
327- <form action="<?php echo WEB_URL ;?> /admin/?do=user& id=<?php echo $ this ->id ; ?> " method="POST">
327+ <form action="<?php echo WEB_URL ;?> /admin/?do=user&id=<?php echo $ this ->id ; ?> " method="POST">
328328 <div class="row">
329329 <div class="col-md-2 col-md-offset-2"><strong><?php echo _ ("Role " );?> </strong></div>
330330 <div class="col-md-6"><?php if ($ user ->get_rank () == 0 && $ this ->id != $ _SESSION ['user ' ]){?> <div class="input-group"><select class="form-control" name="permission"><?php foreach ($ permissions as $ key => $ value ) {
@@ -379,7 +379,21 @@ public function render_user_settings()
379379 </div>
380380 <?php
381381 }
382-
382+ if ($ this ->id !=$ _SESSION ['user ' ] && $ user ->get_rank ()<=1 && ($ user ->get_rank ()<$ this ->rank ))
383+ {?>
384+ <div class="row">
385+ <div class="col-md-2 col-md-offset-2"></div>
386+ <div class="col-md-6">
387+ <?php
388+ if ($ this ->active ){
389+ echo '<a href=" ' .WEB_URL .'/admin/?do=user&id= ' .$ this ->id .'&what=toggle" class="btn btn-danger"> ' ._ ("Deactivate user " )."</a> " ;
390+ }else {
391+ echo '<a href=" ' .WEB_URL .'/admin/?do=user&id= ' .$ this ->id .'&what=toggle" class="btn btn-success"> ' ._ ("Activate user " )."</a> " ;
392+ }
393+ ?>
394+ </div>
395+ </div>
396+ <?php }
383397 }
384398
385399 /**
@@ -484,7 +498,7 @@ public static function password_link()
484498
485499 $ token = Token::add ($ id , 'passwd ' , $ time );
486500
487- $ link = WEB_URL ."/admin/?do=lost-password& id= $ id& token= $ token " ;
501+ $ link = WEB_URL ."/admin/?do=lost-password&id= $ id&token= $ token " ;
488502 $ to = $ email ;
489503 $ user = new User ($ id );
490504 $ subject = _ ('Reset password ' ) . ' - ' .NAME ;
@@ -510,7 +524,7 @@ public function email_link(){
510524 $ token = Token::add ($ id , 'email;$email ' , $ time );
511525
512526
513- $ link = WEB_URL ."/admin/?do=change-email& id= $ id& token= $ token " ;
527+ $ link = WEB_URL ."/admin/?do=change-email&id= $ id&token= $ token " ;
514528 $ to = $ email ;
515529 $ subject = _ ('Email change ' ).' - ' .NAME ;
516530 $ msg = sprintf (_ ( "Hi %s!<br>Below you will find link to change your email. The link is valid for 24hrs. If you didn't request this, feel free to ignore it. <br><br><a href= \"%s \">CHANGE EMAIL</a><br><br>If the link doesn't work, copy & paste it into your browser: <br>%s " ), $ user ->get_name (), $ link , $ link );
@@ -588,7 +602,7 @@ public function change_permission(){
588602 $ stmt = $ mysqli ->prepare ("UPDATE users SET permission=? WHERE id=? " );
589603 $ stmt ->bind_param ("si " , $ permission , $ id );
590604 $ stmt ->execute ();
591- header ("Location: " .WEB_URL ."/admin/?do=user& id= " .$ id );
605+ header ("Location: " .WEB_URL ."/admin/?do=user&id= " .$ id );
592606 }
593607 else {
594608 $ message = _ ("You don't have permission to do that! " );
0 commit comments