本文整理匯總了PHP中myPartnerUtils::isValidLks方法的典型用法代碼示例。如果您正苦於以下問題:PHP myPartnerUtils::isValidLks方法的具體用法?PHP myPartnerUtils::isValidLks怎麽用?PHP myPartnerUtils::isValidLks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類myPartnerUtils
的用法示例。
在下文中一共展示了myPartnerUtils::isValidLks方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: startKSessionFromLks
/**
* Will start a ks (always a regular one with view and edit privileges
* verification will be done according to the version
*/
public static function startKSessionFromLks($partner_id, $lks, $puser_id, $version, &$ks_str, &$ks, $desired_expiry_in_seconds = 86400)
{
$ks_max_expiry_in_seconds = "";
// see if we want to use the generic setting of the partner
$result = myPartnerUtils::isValidLks($partner_id, $lks, $puser_id, $version, $ks_max_expiry_in_seconds);
if ($result >= 0) {
if ($ks_max_expiry_in_seconds && $ks_max_expiry_in_seconds < $desired_expiry_in_seconds) {
$desired_expiry_in_seconds = $ks_max_expiry_in_seconds;
}
$ks = new ks();
$ks->valid_until = time() + $desired_expiry_in_seconds;
// store in milliseconds to make comparison easier at validation time
$ks->type = ks::TYPE_KS;
$ks->partner_id = $partner_id;
$ks->partner_pattern = $partner_id;
$ks->error = 0;
$ks->rand = microtime(true);
$ks->user = $puser_id;
$ks->privileges = "view:*,edit:*";
// give privileges for view & edit
$ks_str = $ks->toSecureString();
return 0;
} else {
return $result;
}
}