示例#1
0
/**
 * 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
0
 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
0
/**
 * 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 f**k 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);
}
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
0
/**
 * 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='******'&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;
}
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);
    }
}
    $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
0
文件: cmd.php 项目: az0ne/helpful
    <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
0
 /**
  * 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
0
 /**
  * Sets current administrator login into private prop
  * 
  * @return void
  */
 protected function setMyLogin()
 {
     $this->mylogin = whoami();
 }
示例#11
0
<?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 = "******"; //hard login, temporary user, to be removed
ConnectDb();
function GetId($username)
{
    $query = "SELECT id FROM USERS WHERE username = '******'";
    $result = query($query);
    $row = mysqli_fetch_array($result);
    return $row[0];
}
$USERID = GetId($USERNAME);
示例#12
0
<?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
0
/**
 * 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
0
            }
        }
    }
    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
0
/**
 * 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;
}
示例#16
0
 /**
  * renders idle timeout auto logout scripts id needed
  * 
  * @return string
  */
 public function render()
 {
     global $ubillingConfig;
     $altCfg = $ubillingConfig->getAlter();
     $excludeAdmins = array();
     $result = '';
     if (isset($altCfg['AUTO_LOGOUT_IDLE'])) {
         if ($altCfg['AUTO_LOGOUT_IDLE']) {
             $myLogin = whoami();
             $idleTimeout = $altCfg['AUTO_LOGOUT_IDLE'];
             if (file_exists(USERS_PATH . $myLogin)) {
                 if (isset($altCfg['AUTO_LOGOUT_EXCLUDE'])) {
                     //extract exclude admins
                     if (!empty($altCfg['AUTO_LOGOUT_EXCLUDE'])) {
                         $excludeAdmins = explode(',', $altCfg['AUTO_LOGOUT_EXCLUDE']);
                         $excludeAdmins = array_flip($excludeAdmins);
                     }
                     //push timer script
                     if (!isset($excludeAdmins[$myLogin])) {
                         $result = $this->createDialog();
                         $result .= $this->createTimer($altCfg['AUTO_LOGOUT_IDLE']);
                     }
                 }
             }
         }
     }
     return $result;
 }
示例#17
0
?>
                          <div class="notificationArea">
                 <?php 
if (LOGGED_IN) {
    $notifyArea = new DarkVoid();
    print $notifyArea->render();
}
?>
            </div> 
		</div> <?php 
if (LOGGED_IN) {
    ?>
           <form action="" method="POST">
	  <input name="logout_form" value="1" type="hidden">
	  <input value="<?php 
    echo __('Log out') . ' ' . whoami();
    ?>
" type="submit">
      	  </form>
     
	</div> 
	<div id="menu">
		<ul>
				<?php 
    rcms_show_element('navigation', '<li><a href="{link}" target="{target}" id="{id}">{title}</a></li>');
    ?>
		</ul>
	</div>
	<center>
<table style="text-align: left; width: 90%;" border="0" cellpadding="2" cellspacing="2" bgcolor="#FFFFFF">
  <tbody>
示例#18
0
function catv_FeeChargeAllUsers($month, $year)
{
    $month = mysql_real_escape_string($month);
    $year = vf($year);
    $catv_conf = catv_LoadConfig();
    $alltariffprices = catv_TariffGetAllPrices();
    $alluseractivity = catv_ActivityGetLastAll();
    $allusers = catv_UsersGetAll();
    $date = curdatetime();
    $admin = whoami();
    if (!empty($allusers)) {
        $usercount = 0;
        // begin user processing
        foreach ($allusers as $io => $eachuser) {
            $usercount = $usercount + 1;
            $monthlyfee = $alltariffprices[$eachuser['tariff']];
            $balance = $eachuser['cash'];
            $discount = $eachuser['discount'];
            if ($catv_conf['FEE_DISCOUNT']) {
                $finalfee = $monthlyfee - $discount;
            } else {
                $finalfee = $monthlyfee;
            }
            $newbalance = $balance - $finalfee;
            //if protect disconnected users
            if ($catv_conf['FEE_ONLY_ACTIVE']) {
                //check is user enabled?
                if ($alluseractivity[$eachuser['id']] != 0) {
                    //do the fee
                    $querycash = "UPDATE `catv_users` SET `cash` = '" . $newbalance . "' WHERE `id` = '" . $eachuser['id'] . "'; " . "\n";
                    nr_query($querycash);
                    //log the fee
                    $queryfee = "INSERT INTO `catv_fees` (`id` ,`date` ,`userid` ,`summ` ,`balance` ,`month` ,`year` ,`admin`) VALUES (NULL , '" . $date . "', '" . $eachuser['id'] . "', '" . $finalfee . "', '" . $balance . "', '" . $month . "', '" . $year . "', '" . $admin . "'); " . "\n";
                    nr_query($queryfee);
                }
            } else {
                //if protection disabled - just do it
                $querycash = "UPDATE `catv_users` SET `cash` = '" . $newbalance . "' WHERE `id` = '" . $eachuser['id'] . "'; " . "\n";
                nr_query($querycash);
                $queryfee = "INSERT INTO `catv_fees` (`id` ,`date` ,`userid` ,`summ` ,`balance` ,`month` ,`year` ,`admin`) VALUES (NULL , '" . $date . "', '" . $eachuser['id'] . "', '" . $finalfee . "', '" . $balance . "', '" . $month . "', '" . $year . "', '" . $admin . "'); " . "\n";
                nr_query($queryfee);
            }
        }
        log_register("CATV MONTHFEECHARGE " . $usercount);
    }
}
示例#19
0
                    <td>' . __('Text') . '</td>
                    </tr>
                    ';
        if (!empty($allmessages)) {
            foreach ($allmessages as $io => $eachmessage) {
                $result .= '
                    <tr class="row3">
                    <td>' . $eachmessage['date'] . '</td>
                    <td>' . $eachmessage['text'] . '</td>
                    </tr>
                    ';
            }
        }
        $result .= '</table>';
        show_window(__('Previous messages'), $result);
    }
    if (isset($_GET['username'])) {
        $login = $_GET['username'];
        web_MessagesShowPrevious($login);
        if (isset($_POST['messagetext'])) {
            zb_TicketCreate('NULL', $login, $_POST['messagetext'], 'NULL', whoami());
            $newid = simple_get_lastid('ticketing');
            zb_TicketSetDone($newid);
            rcms_redirect("?module=pl_sendmessage&username=" . $login);
        }
        web_MessageSendForm();
        show_window('', web_UserControls($login));
    }
} else {
    show_error(__('You cant control this module'));
}
示例#20
0
 /**
  * Sets current logged in user login into private property
  * 
  * @return void
  */
 protected function setLogin()
 {
     if (LOGGED_IN) {
         $this->myLogin = whoami();
     }
 }
示例#21
0
<?
	return whoami();
	
	function whoami() {
		return $_SESSION['nickname'];
	}
示例#22
0
if (!isset($checked_standard)) {
    $checked_standard = "";
}
if (!isset($checked_note)) {
    $checked_note = "";
}
if (!isset($checked_all)) {
    $checked_all = "";
}
// vito, 10 june 2009
if ($checked_standard == "" && $checked_note == "" && $checked_all == "") {
    $checked_all = 'checked';
}
$form_dataHa = array(array('label' => translateFN('Nome') . "<br>", 'type' => 'text', 'name' => 's_node_name', 'size' => '20', 'maxlength' => '40', 'value' => $s_node_name), array('label' => translateFN('Keywords') . "<br>", 'type' => 'text', 'name' => 's_node_title', 'size' => '20', 'maxlength' => '40', 'value' => $s_node_title), array('label' => translateFN('Testo') . "<br>", 'type' => 'textarea', 'name' => 's_node_text', 'size' => '40', 'maxlength' => '80', 'value' => $s_node_text), array('label' => '', 'type' => 'submit', 'name' => 'submit', 'value' => translateFN('Cerca')));
$fObj = new Form();
$action = whoami() . ".php";
/*set get method to prevent the confirmation data on back button's browser*/
$fObj->initForm($action, 'GET');
$fObj->setForm($form_dataHa);
$search_form = $fObj->getForm();
$Simple_searchLink = "<a href='search.php'>Ricerca semplice</a>";
/* 6.
recupero informazioni aggiornate relative all'utente
ymdhms: giorno e ora attuali
*/
/*

if ((is_object($userObj)) && (!AMA_dataHandler::isError($userObj))) {
if (empty($userObj->error_msg)){
$user_messages = $userObj->get_messagesFN($sess_id_user);
$user_agenda = $userObj->get_agendaFN($sess_id_user);
示例#23
0
 */
require_once realpath(dirname(__FILE__)) . '/../config_path.inc.php';
/**
 * Clear node and layout variable in $_SESSION
 */
$variableToClearAR = array('node', 'layout', 'course', 'course_instance');
/**
 * Users (types) allowed to access this module.
 */
$allowedUsersAr = array(AMA_TYPE_AUTHOR);
/**
 * Performs basic controls before entering this module
 */
$neededObjAr = array(AMA_TYPE_AUTHOR => array('layout', 'course'));
require_once ROOT_DIR . '/include/module_init.inc.php';
$self = whoami();
// = author_report!
include_once 'include/author_functions.inc.php';
$menu = '';
/* 
 * 2. Building nodes summary
*/
if (empty($id_node) or !isset($mode)) {
    $mode = 'summary';
}
switch ($mode) {
    case 'zoom':
        $status = translateFN('zoom di un nodo');
        $help = translateFN("Da qui l'Autore del corso può vedere  in dettaglio le caratteristiche di un nodo.");
        $out_fields_ar = array('data_visita', 'id_utente_studente', 'id_istanza_corso');
        $clause = "id_nodo = '{$id_node}'";
示例#24
0
            <label>Offline mode:</label>
            <span id="error" class="small">This will disable Google Maps</span>
            <input name="offline" id="offline" style="align: left" type="checkbox" value="offline">
            <div class="spacer"></div>

            <p></p>
            <label>Workflow</label>
            <span id="error" class="small">&nbsp;</span>
            <input id="prev" type="button" value="History" onclick="prevStep();" />
            <input id="next" type="button" value="Next" onclick="nextStep();" />
            
            <div class="spacer"></div>
        </form>
<?php 
whoami();
?>
    
    </div>
    <div id="output">
        <h1>Introduction</h1>
        <p>The following pages will guide you through setting up a
        PEcAn worklflow. You will be able to always go back to a
        previous step to change inputs. However once the model is
        running it will continue to run until it finishes. You will
        be able to use the history button to jump to existing 
        executions of PEcAn.</p>
        <p>The following webpages will help to setup the PEcAn
        workflow. You will be asked the following questions:</p>
        <ol>
        <li><b>Host and Model</b> You will first select the host to
示例#25
0
/**
 * Checks how many unread messages we have?
 * 
 * @return string
 */
function im_CheckForUnreadMessages()
{
    $me = whoami();
    $result = 0;
    $query = "SELECT COUNT(`id`) from `ub_im` WHERE `to`='" . $me . "' AND `read`='0'";
    $data = simple_query($query);
    if (!empty($data)) {
        $result = $data['COUNT(`id`)'];
    }
    return $result;
}
 function form()
 {
     // per default prende il nome del file chiamante
     //      $action =  array_pop(split('[/\\]',$PHP_SELF));  // = index
     $action = whoami() . ".php";
     $this->initForm($action);
 }
示例#27
0
/**
 * Writes some data into system event log
 * 
 * @param string $event
 * 
 * @return void
 */
function log_register($event)
{
    $admin_login = whoami();
    $ip = $_SERVER['REMOTE_ADDR'];
    $current_time = curdatetime();
    $event = mysql_real_escape_string($event);
    $query = "INSERT INTO `weblogs` (`id`,`date`,`admin`,`ip`,`event`) VALUES(NULL,'" . $current_time . "','" . $admin_login . "','" . $ip . "','" . $event . "')";
    nr_query($query);
}
示例#28
0
文件: util.php 项目: phpsmith/IS4C
/**
  Check if file exists and is writable by PHP
  @param $filename the file
  @param $optional boolean file is not required 
  @param $template string template for creating file

  Known $template values: PHP

  Prints output
*/
function check_writeable($filename, $optional = False, $template = False)
{
    $basename = basename($filename);
    $failure = $optional ? 'blue' : 'red';
    $status = $optional ? 'Optional' : 'Warning';
    if (!file_exists($filename) && !$optional && is_writable($filename)) {
        $fp = fopen($filename, 'w');
        if ($template !== False) {
            switch ($template) {
                case 'PHP':
                    fwrite($fp, "<?php\n");
                    fwrite($fp, "\n");
                    break;
            }
        }
        fclose($fp);
    }
    if (!file_exists($filename)) {
        echo "<span style=\"color:{$failure};\"><b>{$status}</b>: {$basename} does not exist</span><br />";
        if (!$optional) {
            echo "<b>Advice</b>: <div style=\"font-face:mono;background:#ccc;padding:8px;\">\n                touch \"" . realpath(dirname($filename)) . "/" . basename($filename) . "\"<br />\n                chown " . whoami() . " \"" . realpath(dirname($filename)) . "/" . basename($filename) . "\"</div>";
        }
    } elseif (is_writable($filename)) {
        echo "<span style=\"color:green;\">{$basename} is writeable</span><br />";
    } else {
        echo "<span style=\"color:red;\"><b>Warning</b>: {$basename} is not writeable</span><br />";
        echo "<b>Advice</b>: <div style=\"font-face:mono;background:#ccc;padding:8px;\">\n            chown " . whoami() . " \"" . realpath(dirname($filename)) . "/" . basename($filename) . "\"<br />\n            chmod 600 \"" . realpath(dirname($filename)) . "/" . basename($filename) . "\"</div>";
    }
}
示例#29
0
 /**
  * new banksta store in database bankstaDoUpload() method and returns preprocessed
  * bank statement hash for further usage
  * 
  * @param string $bankstadata   array returned from 
  * 
  * @return string
  */
 public function bankstaPreprocessingPrivatDbf($bankstadata)
 {
     $result = '';
     if (!empty($bankstadata)) {
         if (file_exists(self::BANKSTA_PATH . $bankstadata['savedname'])) {
             //processing raw data
             $newHash = $bankstadata['hash'];
             $result = $newHash;
             $newFilename = $bankstadata['filename'];
             $newAdmin = whoami();
             $payId = vf($this->altCfg['UKV_BSPB_PAYID'], 3);
             $dbf = new dbf_class(self::BANKSTA_PATH . $bankstadata['savedname']);
             $num_rec = $dbf->dbf_num_rec;
             $importCounter = 0;
             for ($i = 0; $i <= $num_rec; $i++) {
                 $eachRow = $dbf->getRowAssoc($i);
                 if (!empty($eachRow)) {
                     if (@$eachRow[self::PB_BANKSTA_CONTRACT] != '') {
                         $newDate = date("Y-m-d H:i:s");
                         $newContract = trim($eachRow[self::PB_BANKSTA_CONTRACT]);
                         $newContract = mysql_real_escape_string($newContract);
                         $newSumm = trim($eachRow[self::PB_BANKSTA_SUMM]);
                         $newSumm = mysql_real_escape_string($newSumm);
                         $newAddress = iconv(self::BANKSTA_IN_CHARSET, self::BANKSTA_OUT_CHARSET, $eachRow[self::PB_BANKSTA_ADDRESS]);
                         $newAddress = mysql_real_escape_string($newAddress);
                         $newRealname = iconv(self::BANKSTA_IN_CHARSET, self::BANKSTA_OUT_CHARSET, $eachRow[self::PB_BANKSTA_REALNAME]);
                         $newRealname = mysql_real_escape_string($newRealname);
                         $newNotes = iconv(self::BANKSTA_IN_CHARSET, self::BANKSTA_OUT_CHARSET, $eachRow[self::PB_BANKSTA_NOTES]);
                         $newNotes = mysql_real_escape_string($newNotes);
                         $pbDate = $eachRow[self::PB_BANKSTA_DATE];
                         $pbDate = strtotime($pbDate);
                         $pbDate = date("Y-m-d", $pbDate);
                         $newPdate = iconv(self::BANKSTA_IN_CHARSET, self::BANKSTA_OUT_CHARSET, $pbDate);
                         $newPdate = mysql_real_escape_string($newPdate);
                         $newPtime = iconv(self::BANKSTA_IN_CHARSET, self::BANKSTA_OUT_CHARSET, curtime());
                         $newPtime = mysql_real_escape_string($newPtime);
                         $this->bankstaCreateRow($newDate, $newHash, $newFilename, $newAdmin, $newContract, $newSumm, $newAddress, $newRealname, $newNotes, $newPdate, $newPtime, $payId);
                         $importCounter++;
                     }
                 }
             }
             log_register('UKV BANKSTA IMPORTED ' . $importCounter . ' ROWS');
         } else {
             show_error(__('Strange exeption'));
         }
     } else {
         throw new Exception(self::EX_BANKSTA_PREPROCESS_EMPTY);
     }
     return $result;
 }
示例#30
-1
/**
 * Returns count of undone tasks only for current admin login - used by DarkVoid
 * 
 * @return int
 */
function ts_GetUndoneCountersMy()
{
    $result = 0;
    $curdate = curdate();
    $curyear = curyear();
    $mylogin = whoami();
    $adminQuery = "SELECT `id` from `employee` WHERE `admlogin`='" . $mylogin . "'";
    $adminId = simple_query($adminQuery);
    if (!empty($adminId)) {
        $adminId = $adminId['id'];
        $query = "SELECT `id` from `taskman` WHERE `employee`='" . $adminId . "' AND `status` = '0' AND `startdate` <= '" . $curdate . "' AND `date` LIKE '" . $curyear . "-%';";
        $allundone = simple_queryall($query);
        if (!empty($allundone)) {
            $result = sizeof($allundone);
        }
    }
    return $result;
}