<div class="row"> <div class="col-md-12"> <a name="login"></a> <?php include snippet("loginForm"); ?> </div> </div> <div class="row"> <div class="col-md-4"> </div> <div class="col-md-6"> <a class="" data-toggle="collapse" data-target="#collapse<?php echo getUniqueId(); ?> ">Show Deeplink</a> <div id="collapse<?php echo $lastUniqueId; ?> " class="collapse"> <input type="text" class="form-control selectOnClick" name="" placeholder="" value="<?php echo getDeeplink(); ?> "> </div> </div> </div> <br> <div class="row">
<?php require_once 'config.inc.php'; require_once 'LiveUser/Admin/Admin.php'; //require_once 'LiveUser/LiveUser.php'; //require_once 'LiveUser/Admin/Perm/Container/DB_Medium.php'; //require_once 'LiveUser/Admin/Auth/Container/DB.php'; $admin = new LiveUser_Admin($conf, 'en'); $res = $admin->perm->setCurrentLanguage('en'); //$res = $admin->perm->addLanguage('en', 'english', 'English language'); $ts = time(); // ADD User //function addUser($handle, $password, $type = null, $active = true, $id = null, $owner_user_id = null, // $owner_group_id = null, $customFields = array()) $user_id = $admin->addUser('martin', 'dummypass', null, true, getUniqueId(), null, null, null); if (PEAR::isError($user_id)) { echo "<pre>"; print_r($user_id); echo "</pre>"; } else { echo 'Created User Id ' . $user_id . '<br />'; } /* // GET User $user = $admin->getUser($user_id); if(PEAR::isError($user)) { echo "<pre>"; print_r($user); echo "</pre>"; }
<?php /** * General example for the Cache component. * * @package Cache * @version 1.4.1 * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved. * @license http://ez.no/licenses/new_bsd New BSD License */ /** * Content view */ // Assuming that the ContentView cache has been initialized correctly in the // index.php: // First retreive tha cache you want to access from the manager. $cache = CacheManager::getCache('ContentView'); // Prepare your data identification, use some attributes and a unique ID $attributes = array('user' => $user, 'nodeid' => $NodeID, 'offset' => $Offset, 'layout' => $layout, 'lang' => $LanguageCode, 'vmode' => $ViewMode); $id = getUniqueId($attributes, $viewParameters); // Initialize data and try to grep from cache $data = ''; if (($data = $cache->restore($id, $attributes)) === false) { // No data in cache or data has expired. Generate new data... // What ever exactly happens to create it in eZp. $data = generateMyData(); // ... and store it inside the cache $cache->store($id, $attributes, $data); } // And that's all! : )
if (!empty($value)) { if ($key == START || $key == END) { if (!preg_match('/^\\d+$/', $value)) { $value = strtotime($value); } $value = strtotime($today->format('Y-m-d ') . date('H:i:s', $value)); } $schedule[$day][$color][$key] = $value; } } } uasort($schedule[$day], "compareStartTimes"); } } $minuteHeight = setMinuteHeight($schedule, $pageHeight); $key = getUniqueId(); $vars = get_defined_vars(); unset($vars['sql']); unset($vars['cache']); unset($vars['cache']); unset($vars['smarty']); $cache->setCache($key, $vars, HierarchicalSimpleCache::IMMORTAL_LIFETIME); header("Location: {$_SERVER['PHP_SELF']}?cache={$key}"); exit; } ?> <!DOCTYPE html> <html> <head> <title>Color Schedule</title> <style type="text/css">
// This cache will use the {@link ezcCacheStorageFilePlain} class to store // cache data. It has the same TTL as the cache defined above. ezcCacheManager::createCache('template', $basePath . '/templates', 'ezcCacheStorageFilePlain', $options); // Somewhere in the application you can access the caches // Get the instance of the cache called "content" // Now the instance of {@link ezcCacheStorageFileArray is created and // returned to be used. Next time you access this cache, the created // instance will be reused. $cache = ezcCacheManager::getCache('content'); // Specify any number of attributes to identify the cache item you want // to store. This attributes can be used later to perform operations // on a set of cache items, that share a common attribute. $attributes = array('node' => 2, 'area' => 'admin', 'lang' => 'en-GB'); // This function is not part of the Cache package. You have to define // unique IDs for your cache items yourself. $id = getUniqueId(); // Initialize the data variable you want to restore $data = ''; // Check if data is available in the cache. The restore method returns // the cached data, if available, or bool false. if (($data = $cache->restore($id, $attributes)) === false) { // The cache item we tried to restore does not exist, so we have to // generate the data. $data = array('This is some data', 'and some more data.'); // For testing we echo something here... echo "No cache data found. Generated some.\n" . var_export($data, true) . "\n"; // Now we store the data in the cache. It will be available through // restore, next time the code is reached $cache->store($id, $data, $attributes); } else { // We found cache data. Let's echo the information.
function fp_createChPassHash($login) { $hash = getUniqueId(); $sql = "UPDATE auth_users SET chpass_hash='" . $hash . "', chpass_hash_date='" . time() . "' WHERE login='******'"; $res = sql_query($sql); if ($res && $hash) { return $hash; } return false; }
echo "<pre>"; print_r($app_id); echo "</pre>"; } else { echo "Added Application {$app_id}<br/>"; } // Add Area $area_id = $perm->addArea($app_id, 'SAMPLE_AREA', 'A Sample Area'); if (PEAR::isError($area_id)) { echo "<pre>"; print_r($area_id); echo "</pre>"; } else { echo "Added Area {$area_id}<br/>"; } $auth_id = getUniqueId(); // Add User $user_id = addUser($auth_id, 'franz_josef', 'dummypass', true, $conf['permContainer']['type']); if ($user_id != FALSE) { echo "Added User {$user_id}<br/>"; } else { echo "Failed to add user<br/>"; } listUsers(); // Add Group $group_id = $perm->addGroup('manager', 'The Managers', TRUE, 'MANAGER'); if (PEAR::isError($group_id)) { echo "<pre>"; print_r($group_id); echo "</pre>"; } else {
/** * Создание хеша и сохранение его в БД * @param $login * @return bool|string */ public function createChPassHash($login) { $hash = getUniqueId(); $sql = "UPDATE {$this->_table} SET chpass_hash='{$hash}', chpass_hash_date='" . time() . "' WHERE login='******'"; $res = sql_query($sql); if ($res && $hash) { return $hash; } return false; }