-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdialog.php
52 lines (41 loc) · 1.32 KB
/
dialog.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
42
43
44
45
46
47
48
49
50
51
52
<?php
/*
* Version: 1.0, 31.05.2012
* by Adam Wysocki, goldpaid777@gmail.com
*
* Copyright (c) 2012 Adam Wysocki
*
* This is simply JS -> PHP connector
*
*/
// Report simple running errors except notices
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Set headers if u need more functionality CORS
header("Access-Control-Allow-Origin: *");
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
//header('Access-Control-Max-Age: 604800');
header('Access-Control-Allow-Headers: x-requested-with');
// Some xampp fixing :/
$_GET['o'] = isset($_GET['o']) ? $_GET['o'] : '';
$_GET['c'] = isset($_GET['c']) ? $_GET['c'] : '';
// Is it required??
if(!preg_match("/^[a-zA-Z0-9_.]+$/i",$_GET['c'])) exit;
if(!preg_match("/^[a-zA-Z0-9_.]+$/i",$_GET['o'])) exit;
// Secure var
$home=true;
// Lets start session handling
session_start();
// Configuration varibles & langs
require_once('config.php');
// Require core class functions
require_once('class/core.class.php');
// Require connector class on type
require_once('class/'.$_GET['c'].'.class.php');
# CONTENT START -------------------
$once = new once($_CONFIG);
if($once->once_creator_check()){
// Require connector depends on type and let it do work
require_once('dialogs/'.$_GET['c'].'-'.$_GET['o'].'.dialog.php');
}
?>