本文整理汇总了PHP中Horde_Url::uriB64Encode方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Url::uriB64Encode方法的具体用法?PHP Horde_Url::uriB64Encode怎么用?PHP Horde_Url::uriB64Encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde_Url
的用法示例。
在下文中一共展示了Horde_Url::uriB64Encode方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getChildren
/**
* Retrieves sub-tasks from the database.
*
* @param string $parentId The parent id for the sub-tasks to
* retrieve.
* @param boolean $include_history Include created/modified info? Not
* currently honored.
*
* @return array List of sub-tasks.
* @throws Nag_Exception
*/
public function getChildren($parentId, $include_history = true)
{
$task_list = $this->_getData()->getObjects();
if (empty($task_list)) {
return array();
}
$tasks = array();
foreach ($task_list as $task) {
if (Horde_Url::uriB64Encode($task['parent']) != $parentId) {
continue;
}
$t = new Nag_Task($this, $this->_buildTask($task));
$children = $this->getChildren($t->id);
$t->mergeChildren($children);
$tasks[] = $t;
}
return $tasks;
}
示例2: constructId
/**
* Construct the ID from the owner name and the folder subpath.
*
* @param string $owner The share owner.
* @param string $name The name of the folder without the namespace prefix.
* @param string $prefix The namespace prefix.
*
* @return string The encoded ID.
*/
public function constructId($owner, $name, $prefix = null)
{
return Horde_Url::uriB64Encode(serialize(array($owner, $name, $prefix)));
}
示例3: generateId
/**
* Generates a connection id and returns it.
*
* @param string $seed A unique ID to be included in the token.
*
* @return string The generated id string.
*/
public static function generateId($seed = '')
{
return Horde_Url::uriB64Encode(pack('H*', hash('sha1', uniqid(mt_rand()) . $seed . (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''))));
}
示例4: _saveEvent
/**
* Saves an event in the backend.
*
* @param Kronolith_Event $event The event to save.
*
* @return string The event id.
* @throws Horde_Mime_Exception
*/
protected function _saveEvent($event, $edit)
{
$this->synchronize();
$action = $edit ? array('action' => 'modify') : array('action' => 'add');
if (!$event->uid) {
$event->uid = $this->_data->generateUID();
$event->id = Horde_Url::uriB64Encode($event->uid);
}
$object = $event->toKolab();
if ($edit) {
$this->_data->modify($object);
} else {
$this->_data->create($object);
}
/* Deal with tags */
if ($edit) {
$this->_updateTags($event);
} else {
$this->_addTags($event);
}
/* Notify about the changed event. */
Kronolith::sendNotification($event, $edit ? 'edit' : 'add');
/* Log the creation/modification of this item in the history log. */
try {
$GLOBALS['injector']->getInstance('Horde_History')->log('kronolith:' . $event->calendar . ':' . $event->uid, $action, true);
} catch (Exception $e) {
Horde::log($e, 'ERR');
}
// refresh IMAP cache
$this->synchronize(true);
if (is_callable('Kolab', 'triggerFreeBusyUpdate')) {
//Kolab::triggerFreeBusyUpdate($this->_data->parseFolder($event->calendar));
}
return $event->id;
}
示例5: _makeKey
/**
* Create an object key for a new object.
*
* @param array $attributes The attributes (in driver keys) of the
* object being added.
*
* @return string A unique ID for the new object.
*/
protected function _makeKey(array $attributes)
{
return Horde_Url::uriB64Encode(isset($attributes['uid']) ? $attributes['uid'] : $this->_generateUid());
}
示例6: get
/**
* Return a new signed token.
*
* @param string $seed A unique ID to be included in the token.
*
* @return string The new token.
*/
public function get($seed = '')
{
$nonce = $this->getNonce();
return Horde_Url::uriB64Encode($nonce . $this->_hash($nonce . $seed));
}
示例7: fromDriver
/**
* Imports a backend specific event object.
*
* @param array $event Backend specific event object that this object
* will represent.
*/
public function fromDriver($event)
{
$this->uid = $event['uid'];
$this->id = Horde_Url::uriB64Encode($event['uid']);
if (isset($event['summary'])) {
$this->title = $event['summary'];
}
if (isset($event['body'])) {
$this->description = $event['body'];
}
if (isset($event['location'])) {
$this->location = $event['location'];
}
if (isset($event['sensitivity']) && ($event['sensitivity'] == 'private' || $event['sensitivity'] == 'confidential')) {
$this->private = true;
}
if (isset($event['organizer']['smtp-address'])) {
if (Kronolith::isUserEmail($GLOBALS['registry']->getAuth(), $event['organizer']['smtp-address'])) {
$this->creator = $GLOBALS['registry']->getAuth();
} else {
$this->creator = $event['organizer']['smtp-address'];
}
}
if (isset($event['alarm'])) {
$this->alarm = $event['alarm'];
}
if (isset($event['horde-alarm-methods'])) {
$this->methods = @unserialize($event['horde-alarm-methods']);
}
$tz_local = date_default_timezone_get();
$this->start = new Horde_Date($event['start-date']);
$this->start->setTimezone($tz_local);
$this->end = new Horde_Date($event['end-date']);
$this->end->setTimezone($tz_local);
$this->durMin = ($this->end->timestamp() - $this->start->timestamp()) / 60;
if (!empty($event['creation-date'])) {
$this->created = new Horde_Date($event['creation-date']);
}
if (!empty($event['last-modification-date'])) {
$this->modified = new Horde_Date($event['last-modification-date']);
}
if (isset($event['show-time-as'])) {
switch ($event['show-time-as']) {
case 'free':
$this->status = Kronolith::STATUS_FREE;
break;
case 'tentative':
$this->status = Kronolith::STATUS_TENTATIVE;
break;
case 'busy':
case 'outofoffice':
default:
$this->status = Kronolith::STATUS_CONFIRMED;
}
} else {
$this->status = Kronolith::STATUS_CONFIRMED;
}
// Recurrence
if (isset($event['recurrence'])) {
if (isset($event['recurrence']['exclusion'])) {
$exceptions = array();
foreach ($event['recurrence']['exclusion'] as $exclusion) {
if (!empty($exclusion)) {
$exceptions[] = $exclusion->format('Ymd');
}
}
$event['recurrence']['exceptions'] = $exceptions;
}
if (isset($event['recurrence']['complete'])) {
$completions = array();
foreach ($event['recurrence']['complete'] as $complete) {
if (!empty($complete)) {
$completions[] = $complete->format('Ymd');
}
}
$event['recurrence']['completions'] = $completions;
}
$this->recurrence = new Horde_Date_Recurrence($this->start);
$this->recurrence->fromKolab($event['recurrence']);
}
// Attendees
$attendee_count = 0;
if (!empty($event['attendee'])) {
foreach ($event['attendee'] as $attendee) {
$name = $attendee['display-name'];
$email = $attendee['smtp-address'];
$role = $attendee['role'];
switch ($role) {
case 'optional':
$role = Kronolith::PART_OPTIONAL;
break;
case 'resource':
$role = Kronolith::PART_NONE;
break;
//.........这里部分代码省略.........
示例8: verifySignedQueryString
/**
* Verify a signature and timestamp on a query string.
*
* @param string $data The signed query string.
* @param integer $now The current time (can override for testing).
*
* @return boolean Whether or not the string was valid.
*/
public static function verifySignedQueryString($data, $now = null)
{
if (is_null($now)) {
$now = time();
}
$pos = strrpos($data, '&_h=');
if ($pos === false) {
return false;
}
$pos += 4;
$queryString = substr($data, 0, $pos);
$hmac = substr($data, $pos);
if ($hmac != Horde_Url::uriB64Encode(hash_hmac('sha1', $queryString, $GLOBALS['conf']['secret_key'], true))) {
return false;
}
// String was not tampered with; now validate timestamp
parse_str($queryString, $values);
return !($values['_t'] + $GLOBALS['conf']['urls']['hmac_lifetime'] * 60 < $now);
}
示例9: _generateId
/**
* Generates a local note ID.
*
* @return string A new note ID.
*/
protected function _generateId()
{
return Horde_Url::uriB64Encode($this->_getData()->generateUid());
}