Adding encryptLink function

This commit is contained in:
user
2012-11-09 16:30:52 -04:00
parent 85db81e978
commit bdceea960f

View File

@@ -576,42 +576,42 @@ class G
public function RenderPage($strTemplate = "default", $strSkin = SYS_SKIN, $objContent = null, $layout = '') {
global $G_CONTENT;
global $G_TEMPLATE;
global $G_SKIN;
global $G_PUBLISH;
global $G_SKIN;
global $G_PUBLISH;
$G_CONTENT = $objContent;
$G_TEMPLATE = $strTemplate;
$G_SKIN = $strSkin;
$G_CONTENT = $objContent;
$G_TEMPLATE = $strTemplate;
$G_SKIN = $strSkin;
try {
$file = g::ExpandPath ( 'skinEngine' ) . 'skinEngine.php';
include $file;
$skinEngine = new SkinEngine ( $G_TEMPLATE, $G_SKIN, $G_CONTENT );
$skinEngine->setLayout ( $layout );
$skinEngine->dispatch ();
} catch ( Exception $e ) {
global $G_PUBLISH;
if (is_null ( $G_PUBLISH )) {
$G_PUBLISH = new Publisher ();
}
if (count ( $G_PUBLISH->Parts ) == 1) {
array_shift ( $G_PUBLISH->Parts );
}
global $oHeadPublisher;
$leimnudInitString = $oHeadPublisher->leimnudInitString;
$oHeadPublisher->clearScripts ();
$oHeadPublisher->leimnudInitString = $leimnudInitString;
$oHeadPublisher->addScriptFile ( '/js/maborak/core/maborak.js' );
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/showMessage', null, array (
'MESSAGE' => $e->getMessage ()
) );
if (class_exists ( 'SkinEngine' )) {
$skinEngine = new SkinEngine ( 'publish', 'blank', '' );
$skinEngine->dispatch ();
} else {
die ( $e->getMessage () );
}
}
try {
$file = g::ExpandPath ( 'skinEngine' ) . 'skinEngine.php';
include $file;
$skinEngine = new SkinEngine ( $G_TEMPLATE, $G_SKIN, $G_CONTENT );
$skinEngine->setLayout ( $layout );
$skinEngine->dispatch ();
} catch ( Exception $e ) {
global $G_PUBLISH;
if (is_null ( $G_PUBLISH )) {
$G_PUBLISH = new Publisher ();
}
if (count ( $G_PUBLISH->Parts ) == 1) {
array_shift ( $G_PUBLISH->Parts );
}
global $oHeadPublisher;
$leimnudInitString = $oHeadPublisher->leimnudInitString;
$oHeadPublisher->clearScripts ();
$oHeadPublisher->leimnudInitString = $leimnudInitString;
$oHeadPublisher->addScriptFile ( '/js/maborak/core/maborak.js' );
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/showMessage', null, array (
'MESSAGE' => $e->getMessage ()
) );
if (class_exists ( 'SkinEngine' )) {
$skinEngine = new SkinEngine ( 'publish', 'blank', '' );
$skinEngine->dispatch ();
} else {
die ( $e->getMessage () );
}
}
}
/**
@@ -2683,4 +2683,21 @@ class G
return $sUID;
//return strtoupper(substr(uniqid(rand(0, 9), false),0,14));
}
/**
* Encrypt URL
*
* @author Fernando Ontiveros Lira <fernando@colosa.com>
* @access public
* @param string $urlLink
* @return string
*/
public function encryptlink ($url)
{
if (defined( 'ENABLE_ENCRYPT' ) && ENABLE_ENCRYPT == 'yes') {
return urlencode( G::encrypt( $url, URL_KEY ) );
} else {
return $url;
}
}
}