0byt3m1n1
Path:
/
data
/
applications
/
aps
/
vtcalendar
/
2.2.2
/
[
Home
]
File: nsoa_gate.php
<?php require_once "nsoa_sso.class"; require_once "nsoa_sso.php"; require_once "config.inc.php"; //wsdl string //$dev_wsdl_str = "http://nawapp1.dev.netsol.com:3300/api/services/AdminService?wsdl"; $wsdl_str = "http://nprov.prod.netsol.com/api/services/AdminService"; //credentials $pid = "iqos"; $pkey = "f87AdZ0f"; if(isset($_REQUEST["appId"]) && isset($_REQUEST["ssoToken"])) { $gid = $_REQUEST["appId"]; $token = $_REQUEST["ssoToken"]; } else { echo("appId or ssoToken not provided<br/>"); exit(0); } //WSIMPR-388 - soap causing problem, switching to json service //$client = connect($wsdl_str); //$result = validateToken($client, $pid, $pkey, $gid, $token); $result = json_validateToken($pid, $pkey, $gid, $token); if($result == true){ setSession(); setColors(); //Call session sets on optional view GetDisplayOption(); redirect("main.php"); }else{ echo ("Validation failed."); } function setSession(){ // session_start(); if (!isset($_COOKIE[$_REQUEST["appId"]])){ session_start(); $value = session_id(); setcookie($_REQUEST["appId"], $value ); } else{ $sid = $_COOKIE[$_REQUEST["appId"]]; session_id($sid); session_start(); } $_SESSION['AUTH_MAINADMIN'] = 1; $_SESSION['AUTH_USERID'] = SSO_ADMIN_LOGIN; $_SESSION['AUTH_SPONSORID'] = 1; $_SESSION['AUTH_SPONSORNAME'] = "Administration"; $_SESSION['AUTH_ADMIN'] = 1; } function setColors(){ require_once('globalsettings.inc.php'); require_once('functions.inc.php'); $database = DBopen(); if (isset($_GET["bgColor"])){//#dfddea $bgColor = $_GET["bgColor"]; if ($bgColor == "#ffffff"){ $bgColor = "#fcfbea";} } else {$bgColor = "#fcfbea";} if (isset($_GET["fontColor"])){//#666666 $fontColor = $_GET["fontColor"]; } else {$fontColor = "#666666";} // $result = DBQuery($database, // "UPDATE vtcal_calendar SET maincolor='".sqlescape($bgColor)."',todaycolor='".sqlescape($bgColor)."',textcolor='".sqlescape($fontColor)."' // WHERE id='".sqlescape($_SESSION["CALENDARID"])."'" ); $result = DBQuery($database, "UPDATE vtcal_calendar SET maincolor='".sqlescape($bgColor)."',textcolor='".sqlescape($fontColor)."' WHERE id='".sqlescape($_SESSION["CALENDARID"])."'" ); if ( !isset($_SESSION["CALENDARID"]) ) $_SESSION["CALENDARID"] = "default"; $database = DB::connect( DATABASE ); $result = DBQuery($database, "SELECT * FROM vtcal_calendar WHERE id='default'"); $calendar = $result->fetchRow(DB_FETCHMODE_ASSOC,0); $_SESSION["TITLE"] = $calendar['title']; $_SESSION["NAME"] = $calendar['name']; $_SESSION["HEADER"] = $calendar['header']; $_SESSION["FOOTER"] = $calendar['footer']; $_SESSION["VIEWAUTHREQUIRED"] = $calendar['viewauthrequired']; $_SESSION["FORWARDEVENTDEFAULT"] = $calendar['forwardeventdefault']; $_SESSION["BGCOLOR"] = $calendar['bgcolor']; $_SESSION["MAINCOLOR"] = $calendar['maincolor']; $_SESSION["TODAYCOLOR"] = $calendar['todaycolor']; $_SESSION["PASTCOLOR"] = $calendar['pastcolor']; $_SESSION["FUTURECOLOR"] = $calendar['futurecolor']; $_SESSION["TEXTCOLOR"] = $calendar['textcolor']; $_SESSION["LINKCOLOR"] = $calendar['linkcolor']; $_SESSION["GRIDCOLOR"] = $calendar['gridcolor']; $_SESSION["AUTH_MAINADMIN"] = 1; $_SESSION["AUTH_USERID"] = SSO_ADMIN_LOGIN; $_SESSION["AUTH_SPONSORID"] = 1; $_SESSION["AUTH_SPONSORNAME"] = "Administration"; $_SESSION["AUTH_ADMIN"] = 1; } function redirect($extra) { /* Redirect to the main.php in the current directory that was requested */ $host = $_SERVER['HTTP_HOST']; $uri = "/".$_REQUEST["appId"];//rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); $extra = 'main.php?view=month';//&appId='.$_REQUEST["appId"]; $target = "http://$host$uri/$extra"; header("Location: $target"); exit; } ?>