Файл: connect.php
Строк: 44
<?php
/**
* connect handler
*
* @package Sngine
* @author Zamblek
*/
// fetch kernal
require('kernal.php');
// valid inputs
$valid['to'] = array('facebook', 'twitter');
if(!in_array($_GET['to'], $valid['to'])) {
SystemError($translate->__("Invalid Link"), $translate->__("You may have clicked an expired link or mistyped the address."));
}
if($_GET['to'] == "facebook") {
// check if facebook connected
if(IsEmpty($systemSetting['FB_APPID']) || IsEmpty($systemSetting['FB_SECRET'])) {
SystemError($translate->__("System Error"), $translate->__("There is some went wrong please try again later."));
}
header('Location: '.User::facebook_getLink());
}elseif ($_GET['to'] == "twitter") {
// check if twitter connected
if(IsEmpty($systemSetting['TW_APPID']) || IsEmpty($systemSetting['TW_SECRET'])) {
SystemError($translate->__("System Error"), $translate->__("There is some went wrong please try again later."));
}
try {
header('Location: '.User::twitter_getLink());
}catch (Exception $e) {
SystemError($translate->__("System Error"), $translate->__("There is some went wrong please try again later."));
}
}
?>