本文整理汇总了PHP中zb_StorageSet函数的典型用法代码示例。如果您正苦于以下问题:PHP zb_StorageSet函数的具体用法?PHP zb_StorageSet怎么用?PHP zb_StorageSet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zb_StorageSet函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: zb_AskoziaGetConf
function zb_AskoziaGetConf()
{
$result = array();
$emptyArray = array();
//getting url
$url = zb_StorageGet('ASKOZIAPBX_URL');
if (empty($url)) {
$url = 'http://sip.isp/';
zb_StorageSet('ASKOZIAPBX_URL', $url);
}
//getting login
$login = zb_StorageGet('ASKOZIAPBX_LOGIN');
if (empty($login)) {
$login = 'admin';
zb_StorageSet('ASKOZIAPBX_LOGIN', $login);
}
//getting password
$password = zb_StorageGet('ASKOZIAPBX_PASSWORD');
if (empty($password)) {
$password = 'askozia';
zb_StorageSet('ASKOZIAPBX_PASSWORD', $password);
}
//getting caching time
$cache = zb_StorageGet('ASKOZIAPBX_CACHETIME');
if (empty($cache)) {
$cache = '1';
zb_StorageSet('ASKOZIAPBX_CACHETIME', $cache);
}
$result['url'] = $url;
$result['login'] = $login;
$result['password'] = $password;
$result['cachetime'] = $cache;
return $result;
}
示例2: zb_PhpConsoleCreateTemplate
function zb_PhpConsoleCreateTemplate($name, $body)
{
$key = 'PHPCONSOLETEMPLATE:' . zb_rand_string(16);
$newtemplatedata = array();
$newtemplatedata['name'] = $name;
$newtemplatedata['body'] = $body;
$value = serialize($newtemplatedata);
zb_StorageSet($key, $value);
}
示例3: zb_PaySysPercentDelete
function zb_PaySysPercentDelete($mark)
{
$mark = mysql_real_escape_string($mark);
$olddata = zb_PaySysPercentGetAll();
$newdata = $olddata;
if (isset($newdata[$mark])) {
unset($newdata[$mark]);
$newdata = serialize($newdata);
$newdata = base64_encode($newdata);
zb_StorageSet('PAYSYSPC', $newdata);
log_register("PAYSYSPC DELETE `" . $mark . "`");
}
}
示例4: zb_SetHelpdeskUnDenied
function zb_SetHelpdeskUnDenied($login)
{
$access = zb_GetHelpdeskDeniedAll();
if (!empty($login)) {
if (isset($access[$login])) {
unset($access[$login]);
$newarray = serialize($access);
$newarray = base64_encode($newarray);
zb_StorageSet('ZBS_HELP_DENIED', $newarray);
log_register("ZBSMAN SET ALLOWED (" . $login . ")");
}
}
}
示例5: zb_AsteriskGetConf
function zb_AsteriskGetConf()
{
$result = array();
$emptyArray = array();
//getting url
$host = zb_StorageGet('ASTERISK_HOST');
if (empty($host)) {
$host = 'localhost';
zb_StorageSet('ASTERISK_HOST', $host);
}
//getting login
$login = zb_StorageGet('ASTERISK_LOGIN');
if (empty($login)) {
$login = 'asterisk';
zb_StorageSet('ASTERISK_LOGIN', $login);
}
//getting DB name
$db = zb_StorageGet('ASTERISK_DB');
if (empty($db)) {
$db = 'asteriskdb';
zb_StorageSet('ASTERISK_DB', $db);
}
//getting CDR table name
$table = zb_StorageGet('ASTERISK_TABLE');
if (empty($table)) {
$table = 'cdr';
zb_StorageSet('ASTERISK_TABLE', $table);
}
//getting password
$password = zb_StorageGet('ASTERISK_PASSWORD');
if (empty($password)) {
$password = 'password';
zb_StorageSet('ASTERISK_PASSWORD', $password);
}
//getting caching time
$cache = zb_StorageGet('ASTERISK_CACHETIME');
if (empty($cache)) {
$cache = '1';
zb_StorageSet('ASTERISK_CACHETIME', $cache);
}
$result['host'] = $host;
$result['db'] = $db;
$result['table'] = $table;
$result['login'] = $login;
$result['password'] = $password;
$result['cachetime'] = $cache;
return $result;
}
示例6: tsms_SetTz
function tsms_SetTz($tz)
{
zb_StorageSet('TSMS_TZ', $tz);
log_register("TSMS TIMEZONE CHANGE");
}
示例7: saveConfig
/**
* saves tariff lines config to database
*
* @param string $newlines new lines, comma separated
*
* @return void
*/
public function saveConfig($newlines)
{
zb_StorageSet('ARPU_LINES', $newlines);
log_register('ARPUREPORT CHANGE CONFIG');
}
示例8: docsis_ModemSnmpWalkSet
function docsis_ModemSnmpWalkSet($path)
{
zb_StorageSet('DOCSIS_SNMPWALK_PATH', $path);
log_register("DOCSIS SNMPWALK SET `" . $path . "`");
}
示例9: wf_Link
$editform .= wf_Link('?module=cashtypes', 'Back', true, 'ubButton');
show_window(__('Edit') . ' ' . __('Cash type'), $editform);
}
}
//creating new cash type
if (isset($_POST['newcashtype'])) {
$newcashtype = mysql_real_escape_string($_POST['newcashtype']);
if (!empty($newcashtype)) {
zb_CashCreateCashType($newcashtype);
rcms_redirect("?module=cashtypes");
} else {
show_error(__('No all of required fields is filled'));
}
}
//setting default cashtype
if (wf_CheckPost(array('setdefaultcashtype'))) {
zb_StorageSet('DEF_CT', $_POST['setdefaultcashtype']);
log_register("CASHTYPE SET DEFAULT [" . $_POST['setdefaultcashtype'] . "]");
rcms_redirect("?module=cashtypes");
}
// Edit form construct
$fieldname = __('Cash type');
$fieldkey = 'cashtype';
$formurl = '?module=cashtypes';
$olddata = zb_CashGetAlltypes();
$form = web_EditorTableDataFormOneField($fieldname, $fieldkey, $formurl, $olddata);
show_window(__('Edit payment types'), $form);
show_window(__('Default cash type'), web_CashCashtypeDefaultForm());
} else {
show_error(__('You cant control this module'));
}
示例10: ts_TaskProblemsEditForm
/**
* Returns task typical problems editing form
*
* @return string
*/
function ts_TaskProblemsEditForm()
{
$rawNotes = zb_StorageGet('PROBLEMS');
//extract old or create new typical problems array
if (!empty($rawNotes)) {
$rawNotes = base64_decode($rawNotes);
$rawNotes = unserialize($rawNotes);
} else {
$emptyArray = array();
$newNotes = serialize($emptyArray);
$newNotes = base64_encode($newNotes);
zb_StorageSet('PROBLEMS', $newNotes);
$rawNotes = $emptyArray;
}
//adding and deletion subroutines
if (wf_CheckPost(array('createtypicalnote'))) {
$toPush = strip_tags($_POST['createtypicalnote']);
array_push($rawNotes, $toPush);
$newNotes = serialize($rawNotes);
$newNotes = base64_encode($newNotes);
zb_StorageSet('PROBLEMS', $newNotes);
log_register('TASKMAN ADD TYPICALPROBLEM');
rcms_redirect("?module=taskman&probsettings=true");
}
if (wf_CheckPost(array('deletetypicalnote', 'typicalnote'))) {
$toUnset = $_POST['typicalnote'];
if (($delkey = array_search($toUnset, $rawNotes)) !== false) {
unset($rawNotes[$delkey]);
}
$newNotes = serialize($rawNotes);
$newNotes = base64_encode($newNotes);
zb_StorageSet('PROBLEMS', $newNotes);
log_register('TASKMAN DELETE TYPICALPROBLEM');
rcms_redirect("?module=taskman&probsettings=true");
}
$rows = '';
$result = wf_Link("?module=taskman", __('Back'), true, 'ubButton');
if (!empty($rawNotes)) {
foreach ($rawNotes as $eachNote) {
$cells = wf_TableCell($eachNote);
$rows .= wf_TableRow($cells, 'row3');
}
}
$result .= wf_TableBody($rows, '100%', '0', '');
$result .= wf_delimiter();
$addinputs = wf_TextInput('createtypicalnote', __('Create'), '', true, '20');
$addinputs .= wf_Submit(__('Save'));
$addform = wf_Form("", "POST", $addinputs, 'glamour');
$result .= $addform;
$delinputs = ts_TaskTypicalNotesSelector(false);
$delinputs .= wf_HiddenInput('deletetypicalnote', 'true');
$delinputs .= wf_Submit(__('Delete'));
$delform = wf_Form("", "POST", $delinputs, 'glamour');
$result .= $delform;
return $result;
}
示例11: saveConfig
/**
* Saves config in database
*
* @return void
*/
public function saveConfig()
{
//TurboSMS configuration
if ($_POST['edittsmsgateway'] != $this->settings['TSMS_GATEWAY']) {
zb_StorageSet('SENDDOG_TSMS_GATEWAY', $_POST['edittsmsgateway']);
log_register('SENDDOG CONFIG SET TSMSGATEWAY `' . $_POST['edittsmsgateway'] . '`');
}
if ($_POST['edittsmslogin'] != $this->settings['TSMS_LOGIN']) {
zb_StorageSet('SENDDOG_TSMS_LOGIN', $_POST['edittsmslogin']);
log_register('SENDDOG CONFIG SET TSMSLOGIN `' . $_POST['edittsmslogin'] . '`');
}
if ($_POST['edittsmspassword'] != $this->settings['TSMS_PASSWORD']) {
zb_StorageSet('SENDDOG_TSMS_PASSWORD', $_POST['edittsmspassword']);
log_register('SENDDOG CONFIG SET TSMSPASSWORD `' . $_POST['edittsmspassword'] . '`');
}
if ($_POST['edittsmssign'] != $this->settings['TSMS_SIGN']) {
zb_StorageSet('SENDDOG_TSMS_SIGN', $_POST['edittsmssign']);
log_register('SENDDOG CONFIG SET TSMSSIGN `' . $_POST['edittsmssign'] . '`');
}
//SMS-Fly configuration
if ($_POST['editsmsflygateway'] != $this->settings['SMSFLY_GATEWAY']) {
zb_StorageSet('SENDDOG_SMSFLY_GATEWAY', $_POST['editsmsflygateway']);
log_register('SENDDOG CONFIG SET SMSFLYGATEWAY `' . $_POST['editsmsflygateway'] . '`');
}
if ($_POST['editsmsflylogin'] != $this->settings['SMSFLY_LOGIN']) {
zb_StorageSet('SENDDOG_SMSFLY_LOGIN', $_POST['editsmsflylogin']);
log_register('SENDDOG CONFIG SET SMSFLYLOGIN `' . $_POST['editsmsflylogin'] . '`');
}
if ($_POST['editsmsflypassword'] != $this->settings['SMSFLY_PASSWORD']) {
zb_StorageSet('SENDDOG_SMSFLY_PASSWORD', $_POST['editsmsflypassword']);
log_register('SENDDOG CONFIG SET SMSFLYPASSWORD `' . $_POST['editsmsflypassword'] . '`');
}
if ($_POST['editsmsflysign'] != $this->settings['SMSFLY_SIGN']) {
zb_StorageSet('SENDDOG_SMSFLY_SIGN', $_POST['editsmsflysign']);
log_register('SENDDOG CONFIG SET SMSFLYSIGN `' . $_POST['editsmsflysign'] . '`');
}
//telegram bot token configuration
if ($_POST['edittelegrambottoken'] != $this->settings['TELEGRAM_BOTTOKEN']) {
zb_StorageSet('SENDDOG_TELEGRAM_BOTTOKEN', $_POST['edittelegrambottoken']);
log_register('SENDDOG CONFIG SET TELEGRAMBOTTOKEN');
}
//default sms service
if ($_POST['defaultsmsservice'] != $this->settings['SMS_SERVICE']) {
zb_StorageSet('SENDDOG_SMS_SERVICE', $_POST['defaultsmsservice']);
log_register('SENDDOG CONFIG SET SMSSERVICE `' . $_POST['defaultsmsservice'] . '`');
}
}
示例12: saveSettings
/**
* save the current settings of watchdog as it posted in settingsForm
*
* @return void
*/
public function saveSettings()
{
if (wf_CheckPost(array('changealert'))) {
zb_StorageSet('WATCHDOG_ALERT', $_POST['changealert']);
zb_StorageSet('WATCHDOG_PHONES', $_POST['changephones']);
zb_StorageSet('WATCHDOG_EMAILS', $_POST['changeemails']);
zb_StorageSet('WATCHDOG_TELEGRAM', $_POST['changetelegram']);
log_register("WATCHDOG SETTINGS CHANGED");
}
}
示例13: web_PaymentsShowGraph
/**
* Shows payments year graph with caching
*
* @param int $year
*/
function web_PaymentsShowGraph($year)
{
$months = months_array();
$year_summ = zb_PaymentsGetYearSumm($year);
$curtime = time();
$yearPayData = array();
$yearStats = array();
$cacheTime = 3600;
//sec intervall to cache
$cells = wf_TableCell('');
$cells .= wf_TableCell(__('Month'));
$cells .= wf_TableCell(__('Payments count'));
$cells .= wf_TableCell(__('ARPU'));
$cells .= wf_TableCell(__('Cash'));
$cells .= wf_TableCell(__('Visual'), '50%');
$rows = wf_TableRow($cells, 'row1');
//caching subroutine
$renewTime = zb_StorageGet('YPD_LAST');
if (empty($renewTime)) {
//first usage
$renewTime = $curtime;
zb_StorageSet('YPD_LAST', $renewTime);
$updateCache = true;
} else {
//cache time already set
$timeShift = $curtime - $renewTime;
if ($timeShift > $cacheTime) {
//cache update needed
$updateCache = true;
} else {
//load data from cache or init new cache
$yearPayData_raw = zb_StorageGet('YPD_CACHE');
if (empty($yearPayData_raw)) {
//first usage
$emptyCache = array();
$emptyCache = serialize($emptyCache);
$emptyCache = base64_encode($emptyCache);
zb_StorageSet('YPD_CACHE', $emptyCache);
$updateCache = true;
} else {
// data loaded from cache
$yearPayData = base64_decode($yearPayData_raw);
$yearPayData = unserialize($yearPayData);
$updateCache = false;
//check is current year already cached?
if (!isset($yearPayData[$year]['graphs'])) {
$updateCache = true;
}
//check is manual cache refresh is needed?
if (wf_CheckGet(array('forcecache'))) {
$updateCache = true;
rcms_redirect("?module=report_finance");
}
}
}
}
if ($updateCache) {
//extracting all of needed payments in one query
$allYearPayments_q = "SELECT * from `payments` WHERE `date` LIKE '" . $year . "-%' AND `summ`>'0';";
$allYearPayments = simple_queryall($allYearPayments_q);
if (!empty($allYearPayments)) {
foreach ($allYearPayments as $idx => $eachYearPayment) {
//Here we can get up to 50% of CPU time on month extraction, but this hacks is to ugly :(
//Benchmark results: http://pastebin.com/i7kadpN7
$statsMonth = date("m", strtotime($eachYearPayment['date']));
if (isset($yearStats[$statsMonth])) {
$yearStats[$statsMonth]['count']++;
$yearStats[$statsMonth]['summ'] = $yearStats[$statsMonth]['summ'] + $eachYearPayment['summ'];
} else {
$yearStats[$statsMonth]['count'] = 1;
$yearStats[$statsMonth]['summ'] = $eachYearPayment['summ'];
}
}
}
foreach ($months as $eachmonth => $monthname) {
$month_summ = isset($yearStats[$eachmonth]) ? $yearStats[$eachmonth]['summ'] : 0;
$paycount = isset($yearStats[$eachmonth]) ? $yearStats[$eachmonth]['count'] : 0;
$cells = wf_TableCell($eachmonth);
$cells .= wf_TableCell(wf_Link('?module=report_finance&month=' . $year . '-' . $eachmonth, rcms_date_localise($monthname)));
$cells .= wf_TableCell($paycount);
$cells .= wf_TableCell(@round($month_summ / $paycount, 2));
$cells .= wf_TableCell(web_roundValue($month_summ, 2));
$cells .= wf_TableCell(web_bar($month_summ, $year_summ));
$rows .= wf_TableRow($cells, 'row3');
}
$result = wf_TableBody($rows, '100%', '0', 'sortable');
$yearPayData[$year]['graphs'] = $result;
//write to cache
zb_StorageSet('YPD_LAST', $curtime);
$newCache = serialize($yearPayData);
$newCache = base64_encode($newCache);
zb_StorageSet('YPD_CACHE', $newCache);
} else {
//take data from cache
if (isset($yearPayData[$year]['graphs'])) {
//.........这里部分代码省略.........
示例14: show_error
show_error(__('No') . ' ' . __('SNMP template'));
}
}
}
}
}
} else {
//display all of available fdb tables
$fdbData_raw = rcms_scandir('./exports/', '*_fdb');
if (!empty($fdbData_raw)) {
//// mac filters setup
if (wf_CheckPost(array('setmacfilters'))) {
//setting new MAC filters
if (!empty($_POST['newmacfilters'])) {
$newFilters = base64_encode($_POST['newmacfilters']);
zb_StorageSet('FDBCACHEMACFILTERS', $newFilters);
}
//deleting old filters
if (isset($_POST['deletemacfilters'])) {
zb_StorageDelete('FDBCACHEMACFILTERS');
}
}
//log download
if (wf_CheckGet(array('dlswpolllog'))) {
zb_FDBTableLogDownload();
}
//push ajax data
if (wf_CheckGet(array('ajax'))) {
if (wf_CheckGet(array('swfilter'))) {
$fdbData_raw = array($_GET['swfilter'] . '_fdb');
}
示例15: saveSettings
public function saveSettings()
{
if (wf_CheckPost(array('changealert'))) {
zb_StorageSet('WATCHDOG_ALERT', $_POST['changealert']);
zb_StorageSet('WATCHDOG_PHONES', $_POST['changephones']);
zb_StorageSet('WATCHDOG_EMAILS', $_POST['changeemails']);
zb_StorageSet('WATCHDOG_TSMS_GATEWAY', $_POST['changetsmsgateway']);
zb_StorageSet('WATCHDOG_TSMS_LOGIN', $_POST['changetsmslogin']);
zb_StorageSet('WATCHDOG_TSMS_PASSWORD', $_POST['changetsmspassword']);
zb_StorageSet('WATCHDOG_TSMS_SIGN', $_POST['changetsmssign']);
log_register("WATCHDOG SETTINGS CHANGED");
}
}