本文整理汇总了PHP中rcms_parse_ini_file函数的典型用法代码示例。如果您正苦于以下问题:PHP rcms_parse_ini_file函数的具体用法?PHP rcms_parse_ini_file怎么用?PHP rcms_parse_ini_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rcms_parse_ini_file函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: zb_AnnihilateUser
function zb_AnnihilateUser($login)
{
global $billing;
$alter_conf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
$user_ip = zb_UserGetIP($login);
$user_aptdata = zb_AddressGetAptData($login);
@($user_aptid = $user_aptdata['aptid']);
zb_AddressDeleteApartment($user_aptid);
zb_AddressOrphanUser($login);
zb_UserDeleteEmail($login);
zb_UserDeleteNotes($login);
zb_UserDeletePhone($login);
zb_UserDeleteRealName($login);
zb_UserDeleteSpeedOverride($login);
if (!$alter_conf['STRICT_CONTRACTS_PROTECT']) {
zb_UserDeleteContract($login);
}
zb_VserviceCashClear($login);
log_register("DELETE VCASH (" . $login . ")");
cf_FlushAllUserCF($login);
zb_FlushAllUserTags($login);
vlan_delete_host($login);
multinet_delete_host($user_ip);
multinet_rebuild_all_handlers();
//destroy stargazer user
$billing->deleteuser($login);
log_register("StgUser DELETE (" . $login . ")");
}
示例2: loadConfig
private function loadConfig()
{
$altercfg = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
if (isset($altercfg['COMPLEX_MASKS']) and isset($altercfg['COMPLEX_CFIDS'])) {
//loads tariff masks
if (!empty($altercfg['COMPLEX_MASKS'])) {
$masksRaw = explode(",", $altercfg['COMPLEX_MASKS']);
if (!empty($masksRaw)) {
foreach ($masksRaw as $eachmask) {
$this->masks[] = "'" . trim($eachmask) . "%'";
}
}
} else {
throw new Exception(self::CPL_EMPTY_EX);
}
//loads contract and enabled flags CFIDs
if (!empty($altercfg['COMPLEX_CFIDS'])) {
if (!empty($altercfg['COMPLEX_CFIDS'])) {
$cfieldsRaw = explode(',', $altercfg['COMPLEX_CFIDS']);
if (sizeof($cfieldsRaw) != '3') {
$this->cfields['contract'] = trim($cfieldsRaw[0]);
$this->cfields['active'] = trim($cfieldsRaw[1]);
} else {
throw new Exception(self::CPL_COUNT_EX);
}
}
} else {
throw new Exception(self::CPL_EMPTY_EX);
}
} else {
throw new Exception(self::CPL_SETTINGS_EX);
}
}
示例3: gravatar_GetAvatar
/**
* Function that shows avatar by user email
*
* @param string $email user email
* @param int $size user avatar size
* @return string
*/
function gravatar_GetAvatar($email, $size = '')
{
$altercfg = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
$getsize = $size != '' ? '?s=' . $size : '';
if (isset($altercfg['GRAVATAR_DEFAULT'])) {
$default = $altercfg['GRAVATAR_DEFAULT'];
} else {
$default = 'monsterid';
}
$url = gravatar_GetUrl($email);
$result = wf_img($url . $getsize . '&d=' . $default);
return $result;
}
示例4: __construct
public function __construct()
{
/* Filter NAS'es id: */
$this->_id = filter_input(INPUT_GET, 'nasid', FILTER_SANITIZE_NUMBER_INT);
$this->_ip = zb_NasGetIpById($this->_id);
/* Load APIs: */
$this->api = new RouterOS();
$this->form = new InputForm();
/* Get NAS current options: */
$this->options = zb_NasOptionsGet($this->_id);
/* Get configurtion: */
$alter = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
$this->config['PASSWORDSHIDE'] = !empty($alter['PASSWORDSHIDE']) ? true : false;
unset($alter);
}
示例5: getQueueData
/**
* Returns array containing all SMS queue data as index=>data
*
* @return array
*/
public function getQueueData()
{
$result = array();
$smsQueue = rcms_scandir(self::QUEUE_PATH);
if (!empty($smsQueue)) {
foreach ($smsQueue as $io => $eachsmsfile) {
$smsDate = date("Y-m-d H:i:s", filectime(self::QUEUE_PATH . $eachsmsfile));
$smsData = rcms_parse_ini_file(self::QUEUE_PATH . $eachsmsfile);
$result[$io]['filename'] = $eachsmsfile;
$result[$io]['date'] = $smsDate;
$result[$io]['number'] = $smsData['NUMBER'];
$result[$io]['message'] = $smsData['MESSAGE'];
}
}
return $result;
}
示例6: cu_GetAllParentUsers
/**
* Returns array of all parent users
*
* @return array
*/
function cu_GetAllParentUsers()
{
$alterconf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
$linkfield = $alterconf['USER_LINKING_FIELD'];
$linkcfid = $alterconf['USER_LINKING_CFID'];
$result = array();
$query_cfs = "SELECT DISTINCT `content` FROM `cfitems` WHERE `typeid`='" . $linkcfid . "'";
$allcfs = simple_queryall($query_cfs);
if (!empty($allcfs)) {
foreach ($allcfs as $io => $eachcf) {
$query_user = "SELECT `login` from `users` WHERE `" . $linkfield . "`='" . $eachcf['content'] . "' ";
$userlogin = simple_query($query_user);
$result[$userlogin['login']] = $eachcf['content'];
}
}
return $result;
}
示例7: zb_DeployConfigOptionOverride
/**
* Appends new option to config with override if old option if exists
*
* @param string $path - config file path
* @param string $option - option key
* @param string $value - option raw value
*
* @return void
*/
function zb_DeployConfigOptionOverride($path, $option, $value)
{
if (file_exists($path)) {
$currentData = rcms_parse_ini_file($path);
if (!isset($currentData[$option])) {
file_put_contents($path, "\n" . $option . '=' . $value . "\n", FILE_APPEND | LOCK_EX);
show_window(__('Added'), __('New option key') . ': ' . $option . ' ' . __('with value') . ': ' . $value . ' to: ' . $path);
log_register("DEPLOY CFG OPTOVR (" . $option . ") GOOD");
} else {
file_put_contents($path, "\n" . $option . '=' . $value . "\n", FILE_APPEND | LOCK_EX);
show_window(__('Notice'), __('Option already exist - overriding') . ': ' . $option . ' value:' . $value . ' in:' . $path);
log_register("DEPLOY CFG OPTOVR (" . $option . ") OVR");
}
} else {
show_error(__('Config not exists'));
log_register("DEPLOY CFG OPTOVR (" . $option . ") FAIL");
}
}
示例8: rcms_parse_ini_file
<?php
$altcfg = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
if ($altcfg['ASKOZIA_ENABLED']) {
function zb_AskoziaGetNumAliases()
{
$result = array();
$rawAliases = zb_StorageGet('ASKOZIAPBX_NUMALIAS');
if (empty($rawAliases)) {
$newAliasses = serialize($result);
$newAliasses = base64_encode($newAliasses);
zb_StorageSet('ASKOZIAPBX_NUMALIAS', $newAliasses);
} else {
$readAlias = base64_decode($rawAliases);
$readAlias = unserialize($readAlias);
$result = $readAlias;
}
return $result;
}
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');
示例9: catv_GlobalControlsShow
<?php
if (cfr('CATVBS')) {
catv_GlobalControlsShow();
$alterconf = rcms_parse_ini_file(CONFIG_PATH . "catv.ini");
set_time_limit(0);
$inputencoding = $alterconf['BS_INCHARSET'];
$outputencoding = $alterconf['BS_OUTCHARSET'];
//upload subroutine
if (isset($_POST['upload'])) {
$upload_done = catvbs_UploadFile();
if ($upload_done) {
//if image sucefully uploaded convert and load in into raw table
$filename = $upload_done;
$filecontent = file_get_contents(DATA_PATH . "banksta/" . $filename);
if ($inputencoding != $outputencoding) {
$filecontent = iconv($inputencoding, $outputencoding, $filecontent);
}
$hash = md5($filecontent);
if (catvbs_CheckHash($hash)) {
$rawid = catvbs_FilePush($filename, $filecontent);
if ($rawid) {
//reparse file into normal processing format
catvbs_ParseRaw($rawid);
log_register("CATV_BANKSTA UPLOAD DONE");
}
} else {
show_window(__('Error'), __('Duplicate file detected'));
log_register("CATV_BANKSTA UPLOAD DUPLICATE");
}
}
示例10: docsis_ModemAdd
function docsis_ModemAdd($maclan)
{
$maclan = mysql_real_escape_string($maclan);
//random mac for usb
$macusb = '14:' . '88' . ':' . rand(10, 99) . ':' . rand(10, 99) . ':' . rand(10, 99) . ':' . rand(10, 99);
$altercfg = rcms_parse_ini_file(CONFIG_PATH . '/alter.ini');
$netid = $altercfg['DOCSIS_MODEM_NETID'];
$nextfreeip = multinet_get_next_freeip('nethosts', 'ip', $netid);
$note = '';
$userbind = '';
$basetemplate = 'short';
$date = curdate();
//check for free ip in subnet
if (!empty($nextfreeip)) {
$nic = str_replace('.', 'x', $nextfreeip);
//check is mac unique?
if (multinet_mac_free($maclan) and check_mac_format($maclan)) {
$query = "INSERT INTO `modems` (\n `id` ,\n `maclan` ,\n `macusb` ,\n `date` ,\n `ip` ,\n `conftemplate` ,\n `userbind` ,\n `nic` ,\n `note`\n )\n VALUES (\n NULL , '" . $maclan . "', '" . $maclan . "', '" . $date . "', '" . $nextfreeip . "', '" . $basetemplate . "', '' , '" . $nic . "', ''\n );";
nr_query($query);
$lastid = simple_get_lastid('modems');
log_register("DOCSIS MODEM ADD MAC" . $maclan . " IP " . $nextfreeip . "[" . $lastid . "]");
multinet_add_host($netid, $nextfreeip, $maclan, '');
multinet_rebuild_all_handlers();
rcms_redirect("?module=docsis&showmodem=" . $lastid);
} else {
show_window(__('Error'), __('This MAC is currently used') . ' ' . __('This MAC have wrong format'));
}
} else {
show_window(__('Error'), __('No free IP available in selected pool'));
}
}
示例11: catv_PaymentsShow
function catv_PaymentsShow($query)
{
$alter_conf = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
$alladrs = catv_GetFullAddressList();
$allrealnames = catv_GetAllRealnames();
$alltypes = zb_CashGetAllCashTypes();
$allapayments = simple_queryall($query);
$total = 0;
$result = '<table width="100%" border="0" class="sortable">';
$result .= '
<tr class="row1">
<td>' . __('ID') . '</td>
<td>' . __('IDENC') . '</td>
<td>' . __('Date') . '</td>
<td>' . __('Cash') . '</td>
<td>' . __('User') . '</td>
<td>' . __('Full address') . '</td>
<td>' . __('Notes') . '</td>
<td>' . __('Admin') . '</td>
</tr>
';
if (!empty($allapayments)) {
foreach ($allapayments as $io => $eachpayment) {
if ($alter_conf['TRANSLATE_PAYMENTS_NOTES']) {
if ($eachpayment['notes'] == '') {
$eachpayment['notes'] = __('CaTV');
}
$eachpayment['notes'] = zb_TranslatePaymentNote($eachpayment['notes'], array());
}
$result .= '
<tr class="row3">
<td>' . $eachpayment['id'] . '</td>
<td>' . zb_NumEncode($eachpayment['id']) . '</td>
<td>' . $eachpayment['date'] . '</td>
<td>' . $eachpayment['summ'] . '</td>
<td> <a href="?module=catv_profile&userid=' . $eachpayment['userid'] . '">' . web_profile_icon() . '</a> ' . @$allrealnames[$eachpayment['userid']] . '</td>
<td>' . @$alladrs[$eachpayment['userid']] . '</td>
<td>' . $eachpayment['notes'] . '</td>
<td>' . $eachpayment['admin'] . '</td>
</tr>
';
if ($eachpayment['summ'] > 0) {
$total = $total + $eachpayment['summ'];
}
}
}
$result .= '</table>';
$result .= '<strong>' . __('Total') . ': ' . $total . '</strong>';
return $result;
}
示例12: zb_AddressGetFullCityaddresslist
/**
* Returns all addres array in view like login=>city address
*
* @return array
*/
function zb_AddressGetFullCityaddresslist()
{
$alterconf = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
$result = array();
$apts = array();
$builds = array();
$city_q = "SELECT * from `city`";
$adrz_q = "SELECT * from `address`";
$apt_q = "SELECT * from `apt`";
$build_q = "SELECT * from build";
$streets_q = "SELECT * from `street`";
$alladdrz = simple_queryall($adrz_q);
$allapt = simple_queryall($apt_q);
$allbuilds = simple_queryall($build_q);
$allstreets = simple_queryall($streets_q);
if (!empty($alladdrz)) {
$cities = zb_AddressGetFullCityNames();
foreach ($alladdrz as $io1 => $eachaddress) {
$address[$eachaddress['id']] = array('login' => $eachaddress['login'], 'aptid' => $eachaddress['aptid']);
}
foreach ($allapt as $io2 => $eachapt) {
$apts[$eachapt['id']] = array('apt' => $eachapt['apt'], 'buildid' => $eachapt['buildid']);
}
foreach ($allbuilds as $io3 => $eachbuild) {
$builds[$eachbuild['id']] = array('buildnum' => $eachbuild['buildnum'], 'streetid' => $eachbuild['streetid']);
}
foreach ($allstreets as $io4 => $eachstreet) {
$streets[$eachstreet['id']] = array('streetname' => $eachstreet['streetname'], 'cityid' => $eachstreet['cityid']);
}
foreach ($address as $io5 => $eachaddress) {
$apartment = $apts[$eachaddress['aptid']]['apt'];
$building = $builds[$apts[$eachaddress['aptid']]['buildid']]['buildnum'];
$streetname = $streets[$builds[$apts[$eachaddress['aptid']]['buildid']]['streetid']]['streetname'];
$cityid = $streets[$builds[$apts[$eachaddress['aptid']]['buildid']]['streetid']]['cityid'];
// zero apt handle
if ($alterconf['ZERO_TOLERANCE']) {
if ($apartment == 0) {
$apartment_filtered = '';
} else {
$apartment_filtered = '/' . $apartment;
}
} else {
$apartment_filtered = '/' . $apartment;
}
//only city display option
$result[$eachaddress['login']] = $cities[$cityid] . ' ' . $streetname . ' ' . $building . $apartment_filtered;
}
}
return $result;
}
示例13: ts_CreateTask
/**
* Creates new task in database
*
* @param string $startdate
* @param string $starttime
* @param string $address
* @param string $login
* @param string $phone
* @param int $jobtypeid
* @param int $employeeid
* @param string $jobnote
*
* @return void
*/
function ts_CreateTask($startdate, $starttime, $address, $login, $phone, $jobtypeid, $employeeid, $jobnote)
{
$altercfg = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
$curdate = curdatetime();
$admin = whoami();
$address = str_replace('\'', '`', $address);
$address = mysql_real_escape_string($address);
$login = mysql_real_escape_string($login);
$phone = mysql_real_escape_string($phone);
$startdate = mysql_real_escape_string($startdate);
$jobSendTime = !empty($starttime) ? ' ' . date("H:i", strtotime($starttime)) : '';
if (!empty($starttime)) {
$starttime = "'" . mysql_real_escape_string($starttime) . "'";
} else {
$starttime = 'NULL';
}
$jobtypeid = vf($jobtypeid, 3);
$employeeid = vf($employeeid, 3);
$jobnote = mysql_real_escape_string($jobnote);
$smsData = 'NULL';
//store sms for backround processing via watchdog
if ($altercfg['WATCHDOG_ENABLED']) {
if (isset($_POST['newtasksendsms'])) {
$newSmsText = $address . ' ' . $phone . ' ' . $jobnote . $jobSendTime;
$smsDataRaw = ts_SendSMS($employeeid, $newSmsText);
if (!empty($smsDataRaw)) {
$smsData = serialize($smsDataRaw);
$smsData = "'" . base64_encode($smsData) . "'";
}
}
}
$query = "INSERT INTO `taskman` (`id` , `date` , `address` , `login` , `jobtype` , `jobnote` , `phone` , `employee` , `employeedone` ,`donenote` , `startdate` ,`starttime`, `enddate` , `admin` , `status`,`smsdata`)\n VALUES (NULL , '" . $curdate . "', '" . $address . "', '" . $login . "', '" . $jobtypeid . "', '" . $jobnote . "', '" . $phone . "', '" . $employeeid . "',NULL, NULL , '" . $startdate . "'," . $starttime . ",NULL , '" . $admin . "', '0'," . $smsData . ");";
nr_query($query);
//flushing darkvoid
$darkVoid = new DarkVoid();
$darkVoid->flushCache();
log_register("TASKMAN CREATE `" . $address . "`");
}
示例14: __construct
public function __construct()
{
$this->loadTemplates();
$this->altcfg = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
}
示例15: web_ExpressCardRegForm
/**
* Shows user register form of express card
*
*
* @return string
*/
function web_ExpressCardRegForm()
{
$altconf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
$allcontracts = zb_UserGetAllContracts();
//contract proposal
$top_offset = 100000;
//contract generation mode default
if ($altconf['CONTRACT_GENERATION_DEFAULT']) {
for ($i = 1; $i < $top_offset; $i++) {
if (!isset($allcontracts[$i])) {
$contract = $i;
break;
}
}
} else {
//alternate generation method
$max_contract = max(array_keys($allcontracts));
$contract = $max_contract + 1;
}
$mac = '14:' . '88' . ':' . rand(10, 99) . ':' . rand(10, 99) . ':' . rand(10, 99) . ':' . rand(10, 99);
$phone = '';
$mobile = '';
$email = '';
$notes = '';
$stgdata = '';
$currenttariff = '';
$birthdate = '';
$passportnum = '';
$passportdate = '';
$passportwho = '';
$pcity = '';
$pstreet = '';
$pbuild = '';
$papt = '';
$inputs = zb_AjaxLoader() . wf_delimiter();
$inputs .= __('Contract');
$inputs .= wf_TextInput('newcontract', '', $contract, false, '10');
$inputs .= __('Contract date');
$inputs .= wf_DatePickerPreset('newcontractdate', @$allcontractdates[$contract]);
$inputs .= wf_delimiter();
$inputs .= __('Surname');
$inputs .= wf_TextInput('newsurname', '', '', false, '20');
$inputs .= __('Name');
$inputs .= wf_TextInput('newname', '', '', false, '20');
$inputs .= __('Patronymic');
$inputs .= wf_TextInput('newpatronymic', '', '', false, '20');
$inputs .= __('Birth date');
$inputs .= wf_DatePickerPreset('newbirthdate', $birthdate);
$inputs .= wf_delimiter();
$inputs .= __('Passport number');
$inputs .= wf_TextInput('newpassportnum', '', $passportnum, false, '30');
$inputs .= __('Date of issue');
$inputs .= wf_DatePickerPreset('newpassportdate', $passportdate);
$inputs .= __('Issuing authority');
$inputs .= wf_TextInput('newpassportwho', '', $passportwho, false, '40');
$inputs .= wf_delimiter();
$inputs .= __('Phone');
$inputs .= wf_TextInput('newphone', '', $phone, false, '20');
$inputs .= __('Mobile');
$inputs .= wf_TextInput('newmobile', '', $mobile, false, '20');
$inputs .= __('email');
$inputs .= wf_TextInput('newemail', '', $email, false, '20');
$inputs .= wf_delimiter();
$inputs .= wf_tag('fieldset');
//address data form
$inputs .= __('Address of service') . ' ';
//new address creation form
$inputs .= web_ExpressAddressOccupancyForm();
$inputs .= wf_delimiter();
//additional address fields
$inputs .= __('Registration address') . ' ';
$inputs .= zb_JSHider();
$inputs .= web_PaddressUnhideBox();
$inputs .= web_HidingDiv('paddress');
$inputs .= __('City');
$inputs .= wf_TextInput('newpcity', '', $pcity, false, '20');
$inputs .= __('Street');
$inputs .= wf_TextInput('newpstreet', '', $pstreet, false, '20');
$inputs .= __('Build');
$inputs .= wf_TextInput('newpbuild', '', $pbuild, false, '5');
$inputs .= __('Apartment');
$inputs .= wf_TextInput('newpapt', '', $papt, false, '5');
$inputs .= wf_tag('div', true);
$inputs .= wf_tag('fieldset', true);
$inputs .= wf_delimiter();
$inputs .= __('Tariff');
$inputs .= web_ExpressTariffSelector('newtariff', $currenttariff);
$inputs .= __('Service');
$inputs .= web_ExpressServiceSelectorReg();
$inputs .= __('IP');
$inputs .= wf_tag('span', false, '', 'id="dipbox"');
$allservices = multinet_get_services();
if (!empty($allservices)) {
$firstService = $allservices[0];
//.........这里部分代码省略.........