[SUCS Devel] [Git][sucs/doorkey][master] Add ability to ban users and add sucs special service accounts
Imran Hussain
imranh at sucs.org
Wed May 2 11:45:40 BST 2018
Imran Hussain pushed to branch master at sucs / doorkey
Commits:
c02b01a3 by Imran Hussain at 2018-05-02T11:45:38+01:00
Add ability to ban users and add sucs special service accounts
- - - - -
1 changed file:
- public/index.php
Changes:
=====================================
public/index.php
=====================================
--- a/public/index.php
+++ b/public/index.php
@@ -1,5 +1,7 @@
<?php
+$bannedUsers = array("vote","signup","cacti","video");
+
function ip_in_range($ip, $range) {
if (strpos($range, '/') == false) {
$range .= '/32';
@@ -22,12 +24,16 @@ if (!ip_in_range($ipAddr, "137.44.10.128/25")){
}
if(isset($_REQUEST['username'])) {
- $username = $_REQUEST['username'];
+ $username = strtolower($_REQUEST['username']);
}
if(isset($_REQUEST['password'])) {
$password = $_REQUEST['password'];
}
+if ( in_array($username,$bannedUsers) ) {
+ die("u r b&");
+}
+
include_once("../ldap-auth.php");
$isAuthd = ldapAuth($username, $password);
View it on GitLab: https://projects.sucs.org/sucs/doorkey/commit/c02b01a31278f4ab2476c254655a8a9538cae689
---
View it on GitLab: https://projects.sucs.org/sucs/doorkey/commit/c02b01a31278f4ab2476c254655a8a9538cae689
You're receiving this email because of your account on projects.sucs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/devel/attachments/20180502/4e3a32c2/attachment.html>
More information about the Devel
mailing list