-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
53 lines (36 loc) · 1.29 KB
/
index.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
53
<?php
function __autoload($className)
{
global $conf;
$fileparts = explode("_",$className);
$classPath = $conf['paths']['basePath'] . "lib/" . implode("/",$fileparts) .".inc.php";
require($classPath);
}
// begin program execution
define("DEBUG_ENABLED",true);
set_time_limit(30);
$profiler = new Debug_Profiler;
$template = new Template_Base("wrapper");
if (isset($_REQUEST['xmpp'])) {
try {
$_xmpp = new XMPP_MucClient(
$_REQUEST['xmpp']['host'],$_REQUEST['xmpp']['port'],$_REQUEST['xmpp']['realm'],$_REQUEST['xmpp']['username'],$_REQUEST['xmpp']['password'], "xmpp/".$_REQUEST['xmpp']['realm']
);
if ($_xmpp->isAuthenticated()) {
$template->populate("status","Authenticated ok");
} else {
$template->populate("status","Could not authenticate");
}
$template->populate("loginform","");
} catch (Exception $e) {
$template->setSubTemplate("loginform","login");
$template->populate("status","<b>Something went wrong:</b><br />" . $e->getMessage()."<br /><br />");
}
} else {
$template->setSubTemplate("loginform","login");
$template->populate("status","");
}
$phtml = (DEBUG_ENABLED)?$profiler->end():"";
$template->populate("profiler", $phtml);
echo $template->output();
?>