forked from SkyhawkXava/fritzco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthenticate.php
41 lines (35 loc) · 1.11 KB
/
authenticate.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/*
* @title Simple Cisco Auth Manager
* @author Christian Bartsch <cb AT dreinulldrei DOT de>
* @copyright (c) Christian Bartsch
* @licenn se GPL v2
* @date 2013-11-16
*
* Provides basic security; certain features, like screenshot, will make the phone contact the
* server and ask for authorization. These credentials must match the data in
* "authenticate.config.inc.php", otherwise the request will be denied.
*
* Please do not use safe passwords used for other tasks, these will be transmitted over
* the network without encryption and can therefore be sniffed.
*/
require_once __DIR__ . '/config/general.config.inc.php';
require_once __DIR__ . '/config/authenticate.config.inc.php';
$getUser = $_GET["UserID"];
$getPass = $_GET["Password"];
$getDevice = $_GET["devicename"];
$result = FALSE;
for ($i = 0; $i <= (count($authdata)-1); $i++) {
if ($authdata[$i]['devicename'] == $getDevice ) {
if (($getUser == $authdata[$i]['UserID']) and ($getPass == $authdata[$i]['Password'])) {
$result = TRUE;
}
break;
}
}
if ($result) {
echo "AUTHORIZED";
} else {
echo "UN-AUTHORIZED";
}
?>