|
Last change
on this file was 16, checked in by maron, 13 years ago |
|
ohlášení
|
-
Property svn:executable
set to
*
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | // messages class
|
|---|
| 4 | // Date: 2012-06-13
|
|---|
| 5 |
|
|---|
| 6 | class Messages
|
|---|
| 7 | {
|
|---|
| 8 |
|
|---|
| 9 | function __construct()
|
|---|
| 10 | {
|
|---|
| 11 | // SQL injection hack protection
|
|---|
| 12 | foreach($_POST as $Index => $Item)
|
|---|
| 13 | {
|
|---|
| 14 | if(is_array($_POST[$Index]))
|
|---|
| 15 | foreach($_POST[$Index] as $Index2 => $Item2) $_POST[$Index][$Index2] = addslashes($Item2);
|
|---|
| 16 | else $_POST[$Index] = addslashes($_POST[$Index]);
|
|---|
| 17 | }
|
|---|
| 18 | foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]);
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | //returns actual page
|
|---|
| 22 | public function WhichPage($Pages) {
|
|---|
| 23 | foreach($Pages as $Key => $Page )
|
|---|
| 24 | {
|
|---|
| 25 | if ( isset($_GET[$Page->GetKey()]) ) {
|
|---|
| 26 | return $Page->GetKey();
|
|---|
| 27 | }
|
|---|
| 28 | }
|
|---|
| 29 | if ($_GET == array()) return 'home';
|
|---|
| 30 | return 'notfound';
|
|---|
| 31 | }
|
|---|
| 32 |
|
|---|
| 33 | //registe messages and send data to obj
|
|---|
| 34 | public function RegMess($User) {
|
|---|
| 35 | $Login = new Message('post','LoginUser',$User,'Login','LoginUser','LoginPass');
|
|---|
| 36 | $Login->Activate();
|
|---|
| 37 |
|
|---|
| 38 | $Regin = new Message('post','RegUser',$User,'Register','Email','RegUser','RegPass','RegPass2');
|
|---|
| 39 | echo ($Regin->Activate());
|
|---|
| 40 |
|
|---|
| 41 | $Logout = new Message('get','logout',$User,'Logout');
|
|---|
| 42 | $Logout->Activate();
|
|---|
| 43 | }
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 | }
|
|---|
| 47 | ?>
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.