File: 0.00.3a/mobile/login.php (View as Code)

1: 2: /* ------------------------------------------------------------- 3: This file is part of FreeDESK 4: 5: FreeDESK is (C) Copyright 2012 David Cutting 6: 7: FreeDESK is free software: you can redistribute it and/or modify 8: it under the terms of the GNU General Public License as published by 9: the Free Software Foundation, either version 3 of the License, or 10: (at your option) any later version. 11: 12: FreeDESK is distributed in the hope that it will be useful, 13: but WITHOUT ANY WARRANTY; without even the implied warranty of 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15: GNU General Public License for more details. 16: 17: You should have received a copy of the GNU General Public License 18: along with FreeDESK. If not, see www.gnu.org/licenses 19: 20: For more information see www.purplepixie.org/freedesk/ 21: -------------------------------------------------------------- */ 22: if (isset($_REQUEST['username'])) 23: { 24: ob_start(); 25: require("../core/FreeDESK.php"); 26: $DESK = new FreeDESK("../"); 27: $DESK->Start(); 28: ob_end_clean(); 29: if($DESK->ContextManager->Open(ContextType::User, "", 30: $_REQUEST['username'], $_REQUEST['password'])) 31: { 32: $sid=$DESK->ContextManager->Session->sid; 33: header("Location: ./?sid=".$sid); 34: exit(); 35: } 36: else 37: { 38: header("Location: ./login.php?e=failed"); 39: exit(); 40: } 41: } 42: else if (isset($_REQUEST['logout'])) 43: { 44: ob_start(); 45: require("../core/FreeDESK.php"); 46: $DESK = new FreeDESK("../"); 47: $DESK->Start(); 48: ob_end_clean(); 49: if($DESK->ContextManager->Open(ContextType::User, $_REQUEST['sid'])) 50: { 51: $DESK->ContextManager->Destroy(); 52: header("Location: login.php?e=logout"); 53: exit(); 54: } 55: else 56: { 57: header("Location: ./login.php?e=logout"); 58: exit(); 59: } 60: } 61: ?> 62: 63: 64: 65: 66: 67: FreeDESK Mobile Interface 68: 69: 70:
71: FreeDESK Mobile 72:
73:
74:
75: 76: 77: if (isset($_REQUEST['e'])) 78: { 79: if ($_REQUEST['e'] == "expired") 80: echo "Session Expired, Please Relogin"; 81: else if ($_REQUEST['e'] == "failed") 82: echo "Login Failed, Incorrect Username or Password"; 83: else if ($_REQUEST['e'] == "logout") 84: echo "You Are Logged Out"; 85: echo "

";
86: } 87: ?> 88: 89: Username
90:

91: Password
92:
93:

94: 95: 96:

97: 98: 99:
100: 101: 102:
103: 104:
105: 106: 107: 108: