Ejemplo n.º 1
0
Archivo: fm2.php Proyecto: romlg/cms36
 function TFm2()
 {
     global $str, $actions;
     TTable::TTable();
     $str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('title' => array('Файловый менеджер', 'File Manager')));
     $field = get('field', false, 'gp');
     if ($field) {
         $actions[$this->name]['return'] = array('OK', 'OK', 'link' => "cnt.sendValues(); ", 'img' => '../third/restore_f2.png', 'display' => 'none');
     }
     $actions[$this->name]['load'] = array('Загрузить', 'Load', 'link' => "\n\t\t\t\t \t  cnt.document.getElementById('createForm').style.visibility='hidden';\n\t\t\t\t  \t  cnt.direction = -1;\n\t\t\t\t\t  cnt.startMainLoad();\n\t\t\t\t\t  cnt.showDownloadFrom();\n\t\t\t\t  ", 'img' => '../third/filesave.png', 'display' => 'none');
     $actions[$this->name]['create'] = array('Создать директорию', 'Create', 'link' => "\n\t\t\t\t \t  cnt.document.getElementById('downloadForm').style.visibility='hidden';\n\t\t\t\t  \t  cnt.direction = -1;\n\t\t\t\t\t  cnt.startMainLoad();\n\t\t\t\t\t  cnt.showCreateFrom();", 'img' => '../third/add_section.png', 'display' => 'none');
     $actions[$this->name]['delete'] = array('Удалить', 'Delete', 'link' => "cnt.Delete();", 'img' => '../third/cancel_f2.png', 'display' => 'none');
     $actions[$this->name]['rename'] = array('Переименовать', 'Rename', 'link' => "\n\t\t\t\t \t  cnt.document.getElementById('changenameForm').style.visibility='hidden';\n\t\t\t\t  \t  cnt.direction = -1;\n\t\t\t\t\t  cnt.startMainLoad();\n\t\t\t\t\t  cnt.showChangenameForm();", 'img' => '../third/menu.png', 'display' => 'none');
     $data = $this->ReadIni('modules/' . $this->name . '/module.ini');
     if (isset($data['module']['watermark']) && $data['module']['watermark']) {
         $actions[$this->name]['watermark'] = array('Водяной знак', 'Water Mark', 'link' => "\n\t\t\t\t\t \t  cnt.document.getElementById('watermarkForm').style.visibility='hidden';\n\t\t\t\t\t  \t  cnt.direction = -1;\n\t\t\t\t\t\t  cnt.startMainLoad();\n\t\t\t\t\t\t  cnt.showWatermarkForm();", 'img' => '../third/generic.png', 'display' => 'block');
     }
     $data['dirs'] = array();
     $data['defaults'] = array();
     $dir = FILES_DIR . domainRootId();
     if (!is_dir($dir) || is_root()) {
         $dir = FILES_DIR;
     }
     $data['dirs'][] = $dir;
     $data['defaults']['dir'] = $dir;
     $this->config = $data;
 }
Ejemplo n.º 2
0
 function Show()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     $this->SetValues();
     require_once core('ajax_table');
     $data['thisname'] = $this->name;
     $data['root'] = is_root();
     $this->AddStrings($data);
     $_tables = sql_getRows('SHOW tables');
     foreach ($_tables as $key => $val) {
         $tables[$val] = $val;
     }
     $_transactions = sql_getColumn('SELECT distinct action FROM ' . $this->table . ' ORDER BY action');
     foreach ($_transactions as $key => $val) {
         $transactions[$val] = $val;
     }
     $where = '';
     if ($this->from_date && $this->to_date) {
         $where = ' UNIX_TIMESTAMP(date)>=' . $this->from_date . ' AND UNIX_TIMESTAMP(date)<=' . $this->to_date;
     }
     $data['table'] = ajax_table(array('columns' => array(array('select' => 'user', 'display' => 'user', 'width' => '1px', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'object', 'display' => 'object', 'width' => '1px', 'flags' => FLAG_SORT | FLAG_FILTER | FLAG_SEARCH, 'filter_type' => 'array', 'filter_value' => array('' => '-- все --') + $tables, 'filter_rule' => 'find_in_set'), array('select' => 'action', 'display' => 'action', 'width' => '1px', 'flags' => FLAG_SORT | FLAG_FILTER | FLAG_SEARCH, 'filter_type' => 'array', 'filter_value' => array('' => '-- все --') + $transactions), array('select' => 'description', 'display' => 'description', 'type' => 'description', 'flags' => FLAG_SEARCH), array('select' => 'date', 'display' => 'date', 'type' => 'datetime', 'width' => '100px', 'flags' => FLAG_SORT)), 'from' => $this->table, 'where' => $where, 'orderby' => 'date DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => '', 'click' => ''), $this);
     $data['navig'] = $this->NavigForm();
     return $this->parse($data, $this->name . '.tmpl');
 }
Ejemplo n.º 3
0
 function Show()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('list_table');
     $data['thisname'] = $this->name;
     $logins = array('' => '-') + sql_getRows('SELECT DISTINCT login FROM ' . $this->table . ' ORDER BY login', true);
     $data['root'] = is_root();
     $this->AddStrings($data);
     $data['table'] = list_table(array('columns' => array(array('select' => 'login', 'display' => 'login', 'flags' => FLAG_SORT | FLAG_SEARCH | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => $logins), array('select' => 'ip', 'display' => 'ip', 'width' => '1px', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'date', 'display' => 'date', 'type' => 'datetime', 'width' => '100px', 'flags' => FLAG_SORT)), 'from' => ' log_access ', 'orderby' => 'date DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => '', 'click' => ''), $this);
     $this->AddStrings($data);
     return $this->Parse($data, LIST_TEMPLATE);
 }
Ejemplo n.º 4
0
    function Show()
    {
        if (!empty($_POST)) {
            $action = get('actions', '', 'p');
            if ($action) {
                if ($this->Allow($action)) {
                    return $this->{$action}();
                } else {
                    return $this->alert_method_not_allowed();
                }
            }
        }
        require_once core('ajax_table');
        $client_id = get('client_id', 0, 'g');
        $ret['thisname'] = $this->name;
        $ret['table'] = ajax_table(array('columns' => array(array('select' => 'em.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'COUNT(*)', 'as' => 'em_count'), array('select' => 'CONCAT(cl.name,CHAR(32),cl.lname,CHAR(32),"&lt;",cl.login,"&gt;")', 'as' => 'to_field', 'display' => $client_id ? NULL : 'to', 'type' => 'to'), array('select' => 'u.id', 'display' => $client_id || is_root() ? 'from' : NULL, 'type' => 'from'), array('select' => 'em.subject', 'display' => 'subject'), array('select' => 'UNIX_TIMESTAMP(em.date)', 'as' => 'from_date', 'display' => 'date', 'type' => 'datetime'), array('select' => 'CONCAT(u.fullname,CHAR(32),"&lt;",u.login,"&gt;")', 'as' => 'u_fullname')), 'from' => $this->table . ' AS em
							LEFT JOIN email_log AS log ON em.id=log.email_id
							LEFT JOIN auth_users AS cl ON log.client_id=cl.id
							LEFT JOIN users AS u ON em.user_id=u.id', 'where' => $client_id ? 'log.client_id=' . $client_id : '', 'orderby' => 'em.date DESC', 'groupby' => 'em.id', 'params' => array('page' => $this->name, 'do' => 'show', 'client_id' => $client_id), 'click' => 'ID=cb.value;', 'dblclick' => 'editItem(id)'), $this);
        return $this->Parse($ret, $this->name . '.tmpl');
    }
Ejemplo n.º 5
0
 function DownloadFile()
 {
     if (!is_root()) {
         return;
     }
     if (!$this->makeDir(BACKUP_DIR)) {
         return;
     }
     $filename = clearFileName($_GET['name']);
     if (!isBackupPathCorrect($filename)) {
         exit;
     }
     $dotpos = strrpos($filename, '.');
     switch (substr($filename, $dotpos + 1, strlen($filename) - $dotpos - 1)) {
         case "bz2":
             $mime_type = "application/x-bzip";
             break;
         case "gz":
             $mime_type = "application/x-gzip";
         default:
             $mime_type = "application/octet-stream";
     }
     if (!file_exists(BACKUP_DIR . '/' . $filename)) {
         exit;
     }
     ob_end_clean();
     Header('Content-Encoding: none');
     Header("Content-Type: " . $mime_type);
     header("Content-Disposition: attachment; filename=\"" . $filename . "\"");
     header("Expires: 0");
     header("Pragma: no-cache");
     $fp = fopen(BACKUP_DIR . '/' . $filename, 'rb');
     while (!feof($fp)) {
         echo fread($fp, 10240);
     }
     fclose($fp);
     exit;
 }
Ejemplo n.º 6
0
 if ($ftp->is_my_ftp($ftp_id) || is_root() || is_admin() && $ftp->is_my_ftp($ftp_id)) {
     $ftp->set_id($ftp_id);
     $ftp->get_ftp();
     echo $layout->title(txt('edit_ftp'), 'icon.png');
     echo $layout->txtdesc(txt('dsc_ftp_title'));
     echo helper_result('update_ftp');
     $form = new phpos_forms();
     echo $form->form_start('update_ftp', helper_ajax('section.edit_account.php'), array('app_params' => ''));
     $form->reload_after_submit(array('nowy'));
     $form->input('hidden', 'action', '', '', 'update_ftp');
     echo $layout->column('50%');
     $form->title($ftp->get_title(), null, ICONS . 'edit.png');
     $form->condition('not_null', true, txt('form_empty_field') . txt('title'));
     $form->input('text', 'ftp_new_title', txt('title'), txt('dsc_ftp_name'), $ftp->get_title());
     $form->input('text', 'ftp_new_desc', txt('desc'), txt('dsc_ftp_desc'), $ftp->get_desc());
     if (is_root() || is_admin()) {
         $items = array('0' => txt('no'), '1' => txt('yes'));
         $form->radio('ftp_new_public', txt('ftp_form_public'), txt('ftp_form_public_desc'), $items, $ftp->get_is_public());
     } else {
         $form->input('hidden', 'ftp_new_public', '', '', '0');
     }
     echo $form->render();
     echo $layout->end('column');
     echo $layout->column('50%');
     $form->title(txt('ftp_authentication'), '', ICONS . 'system_info/key_icon.png');
     $form->condition('not_null', true, txt('form_empty_field') . 'Host');
     $form->input('text', 'ftp_new_host', 'Host/IP', txt('dsc_ftp_host'), $ftp->get_host());
     $form->condition('not_null', true, txt('form_empty_field') . 'Login');
     $form->input('text', 'ftp_new_login', 'Login', txt('dsc_ftp_login'), $ftp->get_login());
     $form->condition('not_null', true, txt('form_empty_field') . txt('password'));
     $form->input('password', 'ftp_new_pass', txt('password'), txt('dsc_ftp_pass'), $ftp->get_password());
Ejemplo n.º 7
0
        die('<strong style="color:orangered">[ ! ]  Cannot create cache folder. Please create it manually. It should have this address: <i>' . CACHE_DIR . '</i></strong>');
    }
}
?>


<?php 
$cnx = db_connect();
// is already installed?
if (mysql_query("DESCRIBE " . TBL_PREFIX . TBL_RECORDS, $cnx)) {
    ?>

  <h3 class="ko">smt2 is already installed</h3>
  <?php 
    // help the root user to unistall smt2 stuff
    $msg = is_root() ? 'you need to <a href="uninstall.php">uninstall here</a> first' : 'please delete all <em>' . TBL_PREFIX . '</em> tables from database';
    ?>
  <p>
    If you want to re-install it, <?php 
    echo $msg;
    ?>
.
  </p>
  
<?php 
} else {
    // before installing, ask user email (will be inserted on DB)
    if (isset($_POST['email'])) {
        $email = trim($_POST['email']);
    }
    // however, it can be changed later, so it won't be validated
Ejemplo n.º 8
0
<?php

if (empty($_POST)) {
    exit;
}
// server settings are required - relative path to smt2 root dir
require '../../../config.php';
// protect extension from being browsed by anyone
require SYS_DIR . 'logincheck.php';
// only the root user can delete logs
if (!is_root()) {
    die_msg($_loginMsg["NOT_ALLOWED"]);
}
if (isset($_GET['id'])) {
    $logQuery = "id='" . (int) $_GET['id'] . "'";
} else {
    if (isset($_GET['cid'])) {
        $logQuery = "client_id='" . $_GET['cid'] . "'";
    } else {
        if (isset($_GET['pid'])) {
            $pageId = (int) $_GET['pid'];
            $logQuery = "cache_id='" . $pageId . "'";
            // delete cached file
            $cacheQuery = "id='" . $pageId . "'";
            $page = db_select(TBL_PREFIX . TBL_CACHE, "file", $cacheQuery);
            if (is_file(CACHE_DIR . $page['file'])) {
                unlink(CACHE_DIR . $page['file']);
            }
            // now delete cache log
            db_delete(TBL_PREFIX . TBL_CACHE, $cacheQuery);
        }
Ejemplo n.º 9
0
        break;
}
if (defined('DESKTOP')) {
    $explorer->config('icon_size_class', 'phpos_icon_desktop_size_medium');
}
/*
**************************
*/
// Shortcucts for params
$action_id = $my_app->get_param('action_id');
$dir_id = $my_app->get_param('dir_id');
$root_id = $my_app->get_param('root_id');
/*
**************************
*/
if (globalconfig('readonly') && !is_root()) {
    $my_app->set_param('readonly', 1);
    $readonly = 1;
    cache_param('readonly');
}
/*
**************************
*/
// Actions (new dir, upload, etc)
include MY_APP_DIR . 'controllers/explorerControllerActions.php';
/*
**************************
*/
// Reset params
$my_app->set_param('action_id', null);
$my_app->set_param('action_param', null);
Ejemplo n.º 10
0
?>
startmenu/switch_arrow_right.png"  id="desktop_switch_right"  title="<?php 
echo txt('desktop_switch_tray_to_local');
?>
"/>
	</div>

</div>

<div id="phpos-menustart_Window_container"></div>
<div id="phpos-menustart_WindowApps_container">	<?php 
require_once PHPOS_DIR . 'controllers/menu_startAppsController.php';
?>
	</div>
<?php 
if (globalconfig('demo_mode') == 1 && !is_root()) {
    echo '<div id="phpos-menustart_Desktop_demo"><span style="font-size:24px">' . txt('demo_mode') . '</span><br />' . txt('demo_mode_desc') . '</div>';
}
?>
<div id="phpos-menustart_Desktop_info"><img src="<?php 
echo ICONS;
?>
desktop_switcher/db.png" style="display:inline-block; vertical-align:middle; padding-right:5px" /><b><?php 
echo txt('desktop_switch_up_desktop');
?>
</b> <?php 
echo txt('desktop_switch_up_db');
?>
</div>

<script>
Ejemplo n.º 11
0
Archivo: tree.php Proyecto: romlg/cms36
 /**
  * Построение дерева
  *
  * @param int $id - от какого элемента строить дерево
  * @param int $level
  * @param int $hidden - если hidden=0, то не показываем скрытые разделы
  * @param int root_id
  * @param array $params
  * @return unknown
  */
 function GetTree($id, $level = -1, $hidden = 1, $root_id, $params = array())
 {
     global $user;
     $level++;
     $root_id = $root_id ? $root_id : domainRootID();
     $deny_ids = '';
     if (!is_root() && !empty($user['deny_ids'])) {
         $deny_ids = $user['deny_ids'];
     }
     if (defined('LANG_SELECT') && LANG_SELECT) {
         $name_select = "IF (name_" . lang() . " <> '', name_" . lang() . ", name_" . LANG_DEFAULT . ") as name";
     } else {
         $name_select = "name";
     }
     if ($this->department_id) {
         $sql = "\n    \t\t\tSELECT\n    \t\t\t\tid, {$name_select}, next, visible, pid, priority, page, type, root_id, pids, level, dir, protected, is_link\n    \t\t\tFROM\n    \t\t\t\t" . $this->table . "\n    \t\t\tWHERE\n                    pid<>id\n                    " . ($this->pids[0] == $this->department_id && (int) $this->pids[$level] ? " AND pid=" . (int) $this->pids[$level] : ' AND pid=' . $this->department_id) . "\n                    " . (!$hidden ? " AND visible>'0'" : " AND visible>='0'") . "\n    \t\t\t\t" . ($deny_ids ? " AND id NOT IN (" . $deny_ids . ")" : "") . "\n    \t\t\tORDER BY\n    \t\t\t\tpriority, name\n    \t\t";
     } else {
         $sql = "\n\t\t\tSELECT\n\t\t\t\tid, {$name_select}, next, visible, pid, priority, page, type, root_id, pids, level, dir, protected, is_link\n\t\t\tFROM\n\t\t\t\t" . $this->table . "\n\t\t\tWHERE\n                root_id='" . $root_id . "'\n                " . ($this->pids[0] == $root_id && (int) $this->pids[$level] ? " AND pid=" . (int) $this->pids[$level] : ' AND pid=' . $root_id) . " AND pid<>id\n                " . (!$hidden ? " AND visible>'0'" : " AND visible>='0'") . "\n\t\t\t\t" . ($deny_ids ? " AND id NOT IN (" . $deny_ids . ")" : "") . "\n\t\t\tORDER BY\n\t\t\t\tpriority, name\n\t\t";
     }
     $rows = sql_getRows($sql);
     $items = array();
     if ($rows) {
         $hidden_url = !$hidden ? "&hidden=0" : "";
         foreach ($rows as $row) {
             $items[$row['id']] = $this->getOneItem($id, $row, $root_id, $hidden_url, $params);
             if ($this->department_root) {
                 if (is_array($this->pids) && $this->pids['0'] == $root_id && in_array($row['id'], $this->pids) && $row['id'] != $row['pid']) {
                     $items[$row['id']]['subtree'] = $this->GetTree($id, $level, $hidden, $root_id, $params);
                 }
             } else {
                 if (is_array($this->pids) && $this->pids['0'] == $this->department_id && in_array($row['id'], $this->pids) && $row['id'] != $row['pid']) {
                     $items[$row['id']]['subtree'] = $this->GetTree($id, $level, $hidden, $root_id, $params);
                 }
             }
         }
     }
     $items_data['items'] =& $items;
     if (count($rows) && $level > 0) {
         $items_data['ul_open'] = '<ul>';
         $items_data['ul_close'] = '</ul>';
     }
     $tpl = 'tree/tree.items.tmpl';
     if ($params['copy']) {
         $tpl = 'tree/tree.items_copy.tmpl';
     } elseif ($params['treeurl']) {
         $tpl = 'tree/treeurl/treeurl.items.tmpl';
     } elseif ($params['treeid']) {
         $tpl = 'tree/treeid/treeid.items.tmpl';
     } elseif ($params['checkboxtree']) {
         $tpl = 'tree/treecheck/treecheck.items.tmpl';
     }
     $tree = Parse($items_data, $tpl);
     return $tree;
 }
Ejemplo n.º 12
0
						
						<div class="nav_icons_container">
						<?php 
echo $html['navbar'];
?>
						</div>
						
						<div class="nav_address_container">
					<?php 
echo $html['addressbar'];
?>
					</div>
					</div>

					<?php 
if (APP_ACTION == 'index' && $my_app->get_param('fs') == 'ftp' || $my_app->get_param('fs') == 'local_files' && (!$readonly && globalconfig('disable_upload') != 1 || is_root())) {
    ?>
					<div id="phpos_explorer_uploader_container" class="easyui-tooltip" title="<?php 
    echo txt('tip_explorer_upload_file');
    ?>
">
						<form enctype="multipart/form-data" method="post" action="<?php 
    echo helper_post('null', array('fs' => $app_param['fs']));
    ?>
" id="upload" style="background: transparent"> 
						
							<input type="hidden" name="phpos_upload" value="1"> 
							<input type="hidden" name="posttest" value="postyes"> 
						
							<img style="height:29px" valign="middle" src="<?php 
    echo PHPOS_WEBROOT_URL;
Ejemplo n.º 13
0
*
* изменения by xfox@rusoft.ru 2006-08:
* + дамп работает как подключаемый файл в движке
* + вывод кешируется в файл
* + соединение поддерживается передачей символов раз в секунду
* - исключен формат .zip
* + файл не отдается пользователю сразу, он сбрасывается на сервер
*   и js возвращает ссылку для его загрузки
*****************************************************************************/
/**
 * Get the variables sent or posted to this script and a core script
 */
$GLOBALS['ob_mode'] = 1;
$GLOBALS['gzip'] = false;
# check rights
if (!is_root() && $user['rights']['mysqldump'] != 15) {
    die("Access denied.");
}
define("EXT_INC_COL", 100);
# max allowed count of extended insert syntax
$db = $_POST["db"];
$GLOBALS['asfile'] = $asfile = $_POST["as"] != "data";
header('Content-Encoding: none');
ob_end_clean();
echo "<html><head><title>Processing database</title></head>\n<body>Dumping: \n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r";
flush();
function first_replace($from, $to, $str)
{
    $pos = strpos($str, $from);
    $start = substr($str, 0, $pos);
    $end = substr($str, $pos + strlen($from), strlen($str) - $pos - strlen($from));
Ejemplo n.º 14
0
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
global $my_app;
$workgroup_id = $my_app->get_param('workgroup_id');
$app_menu = array('title:' . txt('my_server') . ',action:actionGoServer,icon:icon-myserver');
if (is_root() || is_admin()) {
    $app_menu[] = 'title:' . txt('group_section_new_group') . ',action:actionNewGroup,icon:icon-edit_add';
    $app_menu[] = 'title:' . txt('group_section_list') . ',action:actionManageGroups,icon:icon-group';
}
if (!empty($workgroup_id)) {
    $check_group = new phpos_groups();
    if (is_root() || is_admin() && $check_group->im_owner($workgroup_id)) {
        $app_menu[] = 'title:' . txt('group_section_edit_group') . ',action:actionEditGroup,icon:icon-edit';
        $app_menu[] = 'title:' . txt('group_section_group_users') . ',action:actionEditGroupUsers,icon:icon-user';
    }
}
function actionEditGroup($menu_item)
{
    global $my_app;
    $j = winopen(txt('group_section_edit_group'), 'cp', 'app_id:groups@groups_admin', 'section:edit_group,group_id:' . $my_app->get_param('workgroup_id'));
    return $j;
}
function actionEditGroupUsers($menu_item)
{
    global $my_app;
    $j = winopen(txt('group_section_edit_group'), 'cp', 'app_id:groups@groups_admin', 'section:group_users,group_id:' . $my_app->get_param('workgroup_id'));
    return $j;
*/
if (!defined('PHPOS')) {
    die;
}
$tray_icons = glob(PHPOS_DIR . 'plugins/tray.*.php');
$tray_data = array();
foreach ($tray_icons as $tray_plugin) {
    $tray = array();
    include $tray_plugin;
    $tray_data[] = $tray;
}
$c = count($tray_data);
if ($c != 0) {
    for ($i = 0; $i < $c; $i++) {
        $this_tray = $tray_data[$i];
        if ($this_tray['access_level'] < 2 || $this_tray['access_level'] == 2 && is_admin() || is_root()) {
            $wintask = new api_wintask();
            $wintask->setContextMenu($this_tray['context_menu']);
            $js_context_menu .= $wintask->contextMenuRender('phpos_tray_icon_' . $this_tray['id'], 'img', 'left');
            $txt = '';
            if (!empty($this_tray['txt'])) {
                $txt = '<span>' . $this_tray['txt'] . '</span>';
            }
            if ($this_tray['use_custom_icons']) {
                echo '<div id="phpos_tray_icon_' . $this_tray['id'] . '" title="' . $this_tray['title'] . '" class="phpos_tray_item phpos_tray_item_mouseleave"><img src="' . $this_tray['icons'][0] . '" />' . $txt . '</div>';
            } else {
                echo '<div id="phpos_tray_icon_' . $this_tray['id'] . '" title="' . $this_tray['title'] . '" class="phpos_tray_item phpos_tray_item_mouseleave"><img  src="' . PHPOS_WEBROOT_URL . '_phpos/icons_tray/' . $this_tray['icons'][0] . '" />' . $txt . '</div>';
            }
        }
    }
}
Ejemplo n.º 16
0
    public function render_address_links()
    {
        $links = $this->get_address_links();
        $c = count($links);
        $separator = '<img class="arrow" 
		src="' . THEME_URL . 'icons/arrow_small_right.png">';
        global $my_app;
        $tmp_shared_id = $my_app->get_param('tmp_shared_id');
        if (!empty($tmp_shared_id)) {
            $shared = new phpos_shared();
            $shared->set_id($tmp_shared_id);
            $shared->get_shared();
            $shared_dir = $shared->get_folder_id();
        }
        $in_shared = $my_app->get_param('in_shared');
        /*.............................................. */
        // If not in shared:
        if (!$in_shared) {
            if ($c != 0) {
                for ($i = 0; $i < $c; $i++) {
                    $item = $this->filesystem->get_file_info($links[$i]);
                    if ($item['id'] != $shared_dir) {
                        if (is_root()) {
                            $item = $this->root_homedir_address_parse($item);
                        }
                        $address .= '<a 
						onclick="' . helper_reload(array('dir_id' => $item['id'])) . '" 
						href="javascript:void(0);">' . $item['basename'] . '</a>' . $separator;
                    }
                }
            }
        }
        $address_start = '<a onclick="' . helper_reload(array('dir_id' => $this->filesystem->get_root_directory_id())) . '" 
		href="javascript:void(0);"><b>' . $this->filesystem->protocol_name . '</b></a>';
        /*.............................................. */
        if (APP_ACTION == 'my_server') {
            $address_start = '<a onclick="' . helper_reload(array('dir_id' => $this->filesystem->get_root_directory_id())) . '" 
			href="javascript:void(0);"><b>' . txt('my_server') . '</b></a>';
        }
        /*.............................................. */
        if (APP_ACTION == 'cp') {
            $address_start = '<a onclick="' . helper_reload(array('dir_id' => $this->filesystem->get_root_directory_id())) . '" 
			href="javascript:void(0);"><b>' . txt('control_panel') . '</b></a>';
        }
        /*.............................................. */
        if (APP_ACTION == 'shared') {
            $group = new phpos_groups();
            $group_id = $my_app->get_param('workgroup_id');
            if (!empty($group_id)) {
                $group->set_id($group_id);
                $group->get_group();
                $group_user = new phpos_users();
                $id_user = $my_app->get_param('workgroup_user_id');
                $group_user->set_id_user($id_user);
                $group_user->get_user_by_id();
                $address_start = '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'workgroup\', \'workgroup_id:' . $group_id . ',fs:local_files\')" href="javascript:void(0);"><b>' . $group->get_title() . '</b></a>' . $separator . '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'shared\', \'workgroup_id:' . $group_id . ',workgroup_user_id:' . $id_user . ',fs:local_files\')" href="javascript:void(0);"><b>' . $group_user->get_user_login() . '</b></a>';
            } else {
                $id_user = logged_id();
                $group_user = new phpos_users();
                $group_user->set_id_user($id_user);
                $group_user->get_user_by_id();
                $address_start = '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'shared\', \'workgroup_id:0,fs:local_files\')" href="javascript:void(0);"><b>' . $group_user->get_user_login() . '</b></a>';
            }
        }
        /*.............................................. */
        if (APP_ACTION == 'workgroup') {
            $group = new phpos_groups();
            $group_id = $my_app->get_param('workgroup_id');
            if (!empty($group_id)) {
                $group->set_id($group_id);
                $group->get_group();
                $address_start = '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'workgroup\', \'workgroup_id:' . $group_id . ',fs:local_files\')" href="javascript:void(0);"><b>' . $group->get_title() . '</b></a>';
            } else {
                $address_start = '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'workgroup\', \'workgroup_id:0,fs:local_files\')" href="javascript:void(0);"><b>Workgroups</b></a>';
            }
        }
        $in_shared = $my_app->get_param('in_shared');
        $tmp_shared_id = $my_app->get_param('tmp_shared_id');
        /*.............................................. */
        if (APP_ACTION == 'index' && (defined('SHARED') || $in_shared)) {
            $group = new phpos_groups();
            $group_id = $my_app->get_param('workgroup_id');
            $group->set_id($group_id);
            $group->get_group();
            $shared_id = $my_app->get_param('tmp_shared_id');
            $shared = new phpos_shared();
            $shared->set_id($shared_id);
            $shared->get_shared();
            $group_user = new phpos_users();
            $id_user = $shared->get_id_user();
            $group_user->set_id_user($id_user);
            $group_user->get_user_by_id();
            $address_start = '<a 
			onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'shared\', \'workgroup_id:' . $group_id . ',workgroup_user_id:' . $id_user . ',fs:local_files\')" href="javascript:void(0);"><b>' . $group_user->get_user_login() . '</b></a>' . $separator . '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'index\', \'shared_id:' . $shared_id . ',in_shared:1,fs:local_files\')" href="javascript:void(0);"><b>' . $shared->get_title() . '</b></a>';
        }
        /*.............................................. */
        //if(APP_ACTION != 'index') $address = '';
        $address_bar = $address_start . $separator . $address;
        $ftp_id = $my_app->get_param('ftp_id');
        if (!empty($ftp_id)) {
            $ftp = new phpos_ftp();
            $ftp->set_id($ftp_id);
            $ftp->get_ftp();
            $address_bar = '<a 
			onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'index\', \'dir_id:.,ftp_id:' . $ftp_id . ',in_shared:1,fs:ftp\')"  href="javascript:void(0);"><b>' . $ftp->get_login() . '@' . $ftp->get_host() . '</b></a>' . $separator;
        }
        return $address_bar;
    }
Ejemplo n.º 17
0
<?php

// server settings are required - relative path to smt2 root dir
require '../../../config.php';
// protect extension from being browsed by anyone
require SYS_DIR . 'logincheck.php';
// now you have access to all CMS API
include INC_DIR . 'header.php';
// only root user can perform certain operations
$ROOT = is_root();
// load maintenance configuration
require 'config.php';
?>

<h1 id="orphanlogs">Orphan cache logs</h1>
<?php 
echo check_notified_request("orphanlogs");
?>

<?php 
// get cache logs id
$cached = db_select_all(TBL_PREFIX . TBL_CACHE, "id", 1);
$cached = array_flatten($cached);
// get records cache id
$records = db_select_all(TBL_PREFIX . TBL_RECORDS, "cache_id", 1);
$records = array_flatten($records);
// compute difference
$diff = array_diff($cached, $records);
$num = count($diff);
if ($num > 0) {
    ?>
Ejemplo n.º 18
0
 function Editp()
 {
     $root = is_root();
     $whom = $_SESSION['user']['login'];
     $temp = sql_getRow("SELECT *,(total - bonus) as total FROM bills WHERE id=" . $_POST['id']);
     $client = sql_getRow("SELECT * FROM auth_users WHERE id=" . $temp['client_id']);
     $order = sql_getRows("SELECT * FROM cart as c LEFT JOIN products as p on c.product_id=p.id WHERE c.order_id=" . $temp['order_id']);
     if (!$root) {
         if ($temp['received'] < $temp['total']) {
             if ($_POST['fld']['received'] + $temp['received'] > $temp['total']) {
                 return "<script>alert('" . $this->str('rec_big') . "');</script>";
             }
         } else {
             return "<script>alert('" . $this->str('rec_big2') . "');</script>";
         }
     }
     if ($_POST['fld']['received'] > 0 || $root) {
         //--- notify ---
         $this->emailNotify($temp, 'bills_money');
         //--------------
         $temp['received'] += $_POST['fld']['received'];
         if ($_POST['fld']['received'] != 0) {
             $this->in_history('change_money', 'bill', $temp['client_id'], $temp['id'], $_POST['fld']);
             if ($temp['received'] >= $temp['total'] & !empty($order)) {
                 $_POST['fld']['status'] = 'paid';
                 //--- notify ---
                 $this->emailNotify($temp, 'bills_status');
                 //--------------
                 $this->in_history('auto_ch_status', 'bill', $temp['client_id'], $temp['id'], $_POST['fld']);
             } elseif ($temp['received'] < $temp['total']) {
                 $_POST['fld']['status'] = 'new';
                 if ($_POST['fld']['status'] != $temp['status']) {
                     //--- notify ---
                     $this->emailNotify($temp, 'bills_status');
                     //--------------
                     $this->in_history('auto_ch_status_no_money', 'bill', $temp['client_id'], $temp['id'], $_POST['fld']);
                 }
             } elseif (empty($order)) {
                 $_POST['fld']['status'] = 'new';
                 //--- notify ---
                 $this->emailNotify($temp, 'bills_status');
                 //--------------
                 if ($_POST['fld']['status'] != $temp['status']) {
                     $this->in_history('auto_ch_status_no_bill', 'bill', $temp['client_id'], $temp['id'], $_POST['fld']);
                 }
             }
         }
     }
     //только root может отнимать от суммы
     if ($_POST['fld']['received'] < 0 && !$root) {
         return "<script>alert('" . $this->str('error') . "');</script>";
     }
     /*Бонусная система*/
     if ($client['otkat'] != 0) {
         //убираем участие в бриз клубе и перестаем считать откаты
         if ($client['briz_club'] == 1) {
             my_query("UPDATE auth_users SET briz_club = 0, bonus_bill = 0 WHERE id=" . $client['id']);
         }
     } else {
         //проверяем, является ли клиент участником клуба
         if ($client['briz_club'] != 1) {
             //смотри, если текущих денег хватит для оплаты, то не собираем все счета за 2 месяца
             if ($temp['received'] < 3000) {
                 //проверяем оплаченные счета за 2 месяца, на предмет добавления в клуб
                 $date = date('Y-m-d 00:00:00', time() - 60 * 60 * 24 * 61);
                 //время 61 день назад
                 $sql = 'SELECT sum(total) FROM `bills` WHERE client_id=' . $client['id'] . ' and status = "paid" and date_pay > "' . $date . '"';
                 if (sql_getValue($sql) >= 3000) {
                     $client['briz_club'] = 1;
                 }
             } else {
                 $client['briz_club'] = 1;
             }
             //елси его добавляем в клуб то устанавливаем значение для $client['briz_club']
             if ($client['briz_club'] == 1) {
                 my_query("UPDATE auth_users SET bonus_bill = 0, briz_club = 1 WHERE id=" . $client['id']);
             }
         }
         if ($client['briz_club'] == 1) {
             //зачисляем бонусы на счет
             $money = $_POST['fld']['received'];
             if (!empty($money)) {
                 if (abs($money) >= 3000 && abs($money) < 4999) {
                     $bonus = $money * 0.01;
                 }
                 if (abs($money) >= 5000 && abs($money) < 9999) {
                     $bonus = $money * 0.02;
                 }
                 if (abs($money) >= 10000) {
                     $bonus = $money * 0.03;
                 }
                 if (isset($bonus)) {
                     $bonus = round($bonus);
                     //округляем
                     //зачисляем на счет
                     my_query("UPDATE auth_users SET bonus_bill = bonus_bill + " . $bonus . " WHERE id=" . $client['id']);
                     //--- notify ---
                     $array = array('bonus' => $bonus, 'client' => $client);
                     SendNotify('SEND_ADD_BONUS', $client['id'], $array);
                 }
             }
         }
     }
     if ($_POST['fld']['received'] == "0") {
         $_POST['fld']['date_pay'] = "0";
     } else {
         $_POST['fld']['date_pay'] = date('Y-m-d H:i:s');
     }
     $_POST['fld']['received'] = $temp['received'];
     //---- Сохранение ----
     $res = $this->Commit();
     if (is_int($res)) {
         return "<script>alert('" . $this->str('saved') . "');try{window.parent.top.opener.location.reload();window.parent.location.reload();}catch(e){window.parent.location.reload();}finally{}</script>";
     }
     return $this->Error($res);
 }
Ejemplo n.º 19
0
         if ($cloud->new_cloud($tmp_title, $tmp_desc, $tmp_cloud, $tmp_login, $tmp_pass, $tmp_public, $tmp_url, $tmp_param1, $tmp_param2, $tmp_param3, $tmp_param4)) {
             helper_result('new_cloud', 'ok', txt('created'));
             helper_result('new_cloud_result', 'result', 'success');
             helper_result('new_cloud_id', 'var', 1);
         } else {
             helper_result('new_cloud_result', 'result', 'error');
             helper_result('new_cloud', 'error', txt('error'));
         }
         $_POST['action'] = null;
     }
 }
 // update
 if (form_submit('update_cloud')) {
     if ($_POST['action'] == 'update_cloud') {
         $cloud = new phpos_clouds();
         if ($cloud->is_my_cloud($cloud_id) || is_root() || is_admin()) {
             $tmp_title = strip_tags($_POST['cloud_new_title']);
             $tmp_desc = strip_tags($_POST['cloud_new_desc']);
             $tmp_login = strip_tags($_POST['cloud_new_login']);
             $tmp_pass = strip_tags($_POST['cloud_new_pass']);
             $tmp_url = strip_tags($_POST['cloud_new_url']);
             //$tmp_cloud = strip_tags($_POST['cloud_new_type']);
             $tmp_public = strip_tags($_POST['cloud_new_public']);
             $tmp_param1 = strip_tags($_POST['cloud_new_param1']);
             $tmp_param2 = strip_tags($_POST['cloud_new_param2']);
             $tmp_param3 = strip_tags($_POST['cloud_new_param3']);
             $tmp_param4 = strip_tags($_POST['cloud_new_param4']);
             $cloud->set_id($cloud_id);
             if ($cloud->update_cloud($cloud_id, $tmp_title, $tmp_desc, $tmp_login, $tmp_pass, $tmp_public, $tmp_url, $tmp_param1, $tmp_param2, $tmp_param3, $tmp_param4)) {
                 helper_result('update_cloud', 'ok', txt('updated'));
                 helper_result('update_cloud_result', 'result', 'success');
Ejemplo n.º 20
0
 function EditForm()
 {
     global $directories;
     $id = (int) get('id');
     if ($id) {
         $row['order'] = $this->getRow($id);
     }
     $row['id'] = $id;
     $row['root'] = is_root();
     $new = (int) get('new');
     if ($new) {
         $row['new'] = $new;
         $row['payment_types'] = $directories['payment_type'];
     }
     ##################################################
     // дата оформления заказа
     $row['order']['order_date'] = date('d.m.Y', $row['order']['order_date']);
     // получем список товаров по данному заказу
     if (isset($row['order']['id'])) {
         $this->getProductList($row, $row['order']['id']);
         /*
         $row['product_list']=sql_getRows("
         	SELECT c.*,p.*,m.name as manufacturer 
         	FROM cart as c 
         	LEFT JOIN products as p on c.product_id=p.id 
         	LEFT JOIN manufacturers as m on m.id=p.manufacturer_id 
         	WHERE c.order_id=".$row['order']['id']);
         // считаем кол-во продуктов в заказе
         $row['count']=0;
            foreach ($row['product_list'] as $key=>$item){
             $row['count']+=$item['quantity'];
         }
         pr($row['product_list']);
         */
     }
     ################ Доставка #################
     $i = 1;
     if ($row['order']['payment_type'] == 'Bank') {
         foreach ($directories['shipping_type'] as $k => $v) {
             $row['shipping_types'][$k] = $v . " (" . $i . ")";
             $i++;
         }
     } else {
         $row['shipping_types']['none'] = $directories['shipping_type']['none'] . " (3)";
     }
     $shipping_type = get('shipping_type', NULL, 'g');
     if (!isset($shipping_type)) {
         $shipping_type = $row['order']['shipping_type'];
     }
     $shipping = get('shipping', NULL, 'g');
     if (!isset($shipping)) {
         $shipping = $row['order']['shipping'];
     }
     $row['shipping_type'] = $shipping_type;
     $row['shipping'] = $shipping;
     $row['delivery_type'] = $directories['delivery_type'][$row['order']['delivery_type']];
     #############################################
     ##################### Баланс ######################
     //------ Полученные средства по счетам клиента
     $row['balans']['received'] = sql_getValue("SELECT SUM(received) FROM bills WHERE `client_id`=" . $row['order']['client_id'] . " AND `type`!='bonus'");
     //------ Сумма всех стоимостей заказов
     $row['balans']['orders'] = sql_getValue("SELECT SUM(total) - SUM(bonus) FROM orders WHERE `client_id`=" . $row['order']['client_id'] . " AND (`status`='CompletePaid' OR `status`='ReadyPaid' OR `status`='Delivered')");
     //------ Сумма бонусных счетов
     //$row['balans']['bonus']=sql_getValue("SELECT SUM(total) FROM bills WHERE `client_id`=".$row['order']['client_id']." AND `type`='bonus'");
     //------ Баланс клиента
     $row['balans']['total'] = $row['balans']['received'] - $row['balans']['orders'];
     //-$row['balans']['bonus'];
     // получаем счет по данному заказу (только один может быть не отмененный)
     $row['bill'] = sql_getRow("SELECT * FROM bills WHERE status != 'canceled' AND order_id=" . $row['id']);
     //pr($row['bill']);
     // получаем значение currency
     $row['currency'] = sql_getRow("SELECT * FROM currency WHERE name='" . $row['order']['currency'] . "'");
     #################### Actions #####################
     if ($row['balans']['total'] - $row['order']['total'] * $row['currency']['value'] >= '0' || !in_array($row['order']['status'], $this->normal_status)) {
         $temp = 1;
     } else {
         $temp = 0;
     }
     // создаем экшены и меню для админа
     if ($row['root']) {
         // если админ
         if (empty($row['bill'])) {
             $row['upactions'] = '1,1,1';
         } else {
             $row['upactions'] = '0,1,1';
         }
         // Не даем добавлять товары, если счет выписан
         foreach ($this->actions[$row['order']['payment_type']]['0'] as $key => $value) {
             $row['actions'][$key] = $this->str($key);
         }
         foreach ($this->actions[$row['order']['payment_type']]['1'] as $key => $value) {
             $row['actions'][$key] = $this->str($key);
         }
         foreach ($this->order_actions as $key => $value) {
             $row['upactions'] .= ',0';
         }
     } else {
         // если любой кроме админа
         if (empty($row['bill'])) {
             $row['upactions'] = '1,0,1';
         } else {
             $row['upactions'] = '0,0,1';
         }
         // Не даем добавлять товары, если счет выписан
         foreach ($this->statuses as $k => $v) {
             if (in_array($k, $this->actions[$row['order']['payment_type']][$temp][$row['order']['status']])) {
                 $row['upactions'] .= ',1';
             } else {
                 $row['upactions'] .= ',0';
             }
         }
     }
     // добавляем экшены для счетов
     $row['edit'] = true;
     if ($row['order']['status'] != 'Canceled') {
         if (!empty($row['bill'])) {
             // Если поступили средства, то не разрешаем аннулировать
             if ($row['bill']['received'] > 0) {
                 $row['upactions'] .= ',1,0,0';
             } else {
                 $row['upactions'] .= ',1,1,0';
             }
             $row['edit'] = false;
         } else {
             $row['upactions'] .= ',0,0,1';
         }
     } else {
         $row['upactions'] .= ',0,0,0';
     }
     $row['order']['status2'] = $this->str($row['order']['status']);
     $row['order']['payment_type_display'] = $this->str($row['order']['payment_type']);
     $row['order']['payment_types'] = $directories['payment_type'];
     // добавляем в шаблон переменную и парсим
     $this->AddStrings($row);
     return $this->Parse($row, $this->name . '.editform.tmpl');
 }
Ejemplo n.º 21
0
global $readonly, $my_app, $context_fs, $tmp_shared_id;
$app_menu = array('title:' . txt('new_folder') . ',action:actionNewFolder,icon:icon-folder_files', 'title:' . txt('my_server') . ',action:actionGoServer,icon:icon-myserver', 'title:' . txt('control_panel') . ',action:actionGoCP,icon:icon-login');
if (!empty($tmp_shared_id)) {
    $shared = new phpos_shared();
    if ($shared->is_my($tmp_shared_id)) {
        $app_menu[] = 'title:' . txt('stop_share_folder') . ',action:actionStopShare,icon:icon-cancel';
    }
}
if (!$readonly && $context_fs != 'db_mysql') {
    $app_menu[] = 'title:' . txt('upload') . ',action:actionUpload,icon:icon-download';
}
$app_menu[] = 'title:' . txt('icon_size') . ',action:actionChangeIcons,icon:icon-application';
$app_menu[] = array('title:' . txt('icon_size_s') . ',icon_size:small,check:icon_size,if:' . $my_app->get_param('icon_size') . ',action:actionChangeIcons', 'title:' . txt('icon_size_m') . ',icon_size:medium,check:icon_size,if:' . $my_app->get_param('icon_size') . ',action:actionChangeIcons');
if ($context_fs == 'ftp') {
    $check_ftp = new phpos_ftp();
    if (is_root() || $check_ftp->is_my($my_app->get_param('ftp_id'))) {
        $app_menu[] = 'title:' . txt('dsc_ftp_a_edit') . ',action:actionEditFtp,icon:icon-edit';
    }
}
function actionEditFtp($menu_item)
{
    global $my_app;
    $j = winopen(txt('dsc_ftp_a_edit'), 'cp', 'app_id:ftp@index', 'section:edit_account,ftp_id:' . $my_app->get_param('ftp_id'));
    return $j;
}
function actionNewFolder($menu_item)
{
    global $context_location, $context_dir_id;
    $j = winmodal(txt('new_folder'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',back:null, dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID);
    return $j;
}
Ejemplo n.º 22
0
function format_fields($user, $isAdmin)
{
    global $ROLES, $ROOT;
    $rnd = mt_rand();
    // to match correctly label with id
    $self = $user['login'] === $_SESSION['login'];
    $f = "";
    if (!$isAdmin && $user !== null) {
        $role = db_select(TBL_PREFIX . TBL_ROLES, "*", "id='" . $user['role_id'] . "'");
        if ($role) {
            $f .= 'Your current role is <strong>' . $role['name'] . '</strong>';
            if (!empty($role['description'])) {
                $f .= ' (' . $role['description'] . ').';
            }
        } else {
            $f .= 'You do not have a role assigned.';
        }
    }
    if ($isAdmin) {
        $f .= '<div class="wrapper smallround pl">' . PHP_EOL;
    }
    // check user status
    if ($user !== null) {
        $timediff = time() - strtotime($user['last_access']);
        if ($timediff < 5 * 60) {
            $status = "online";
        } else {
            if ($timediff < 10 * 60) {
                $status = "away";
            } else {
                $status = "offline";
            }
        }
        if ($isAdmin) {
            // show pretty dates instead of timestamps if PHP >= 5.2.0
            if (check_systemversion("php", "5.2.0")) {
                $usePrettyDate = true;
                require_once SYS_DIR . 'prettyDate.php';
            }
            if ($user !== null) {
                $reg = $usePrettyDate ? prettyDate::getStringResolved($user['registered']) : $user['registered'];
                $upd = $usePrettyDate ? prettyDate::getStringResolved($user['last_access']) : $user['last_access'];
                $accesses = ' <small class="mini">Registered ' . $reg . '. Last access: <em>' . $upd . '</em>.</small>';
            }
        }
        $f .= '<h2>';
        $f .= '<img src="' . ADMIN_PATH . 'css/user-' . $status . '.png" alt="[' . $status . ']" title="User ' . $status . '" /> ';
        $f .= $user['login'] . $accesses;
        $f .= '</h2>' . PHP_EOL;
    }
    // create form ---------------------------------------------------------------
    $f .= '<form action="saveaccount.php" method="post">' . PHP_EOL;
    $f .= '<fieldset>' . PHP_EOL;
    // the superadmin user cannot change its own role
    if ($ROOT && !$self) {
        $f .= '<div class="fl mr">' . PHP_EOL;
        $f .= '<label for="role_id' . $rnd . '">role</label>' . PHP_EOL;
        // begin select ------------------------------------------------------------
        $f .= '<select id="role_id' . $rnd . '" name="role_id" class="text block">' . PHP_EOL;
        $f .= '<option value="0">...</option>' . PHP_EOL;
        foreach ($ROLES as $role) {
            $selected = $user['role_id'] == $role['id'] ? ' selected="selected"' : null;
            $f .= '<option value="' . $role['id'] . '"' . $selected . '>' . $role['name'] . '</option>' . PHP_EOL;
        }
        $f .= '</select>' . PHP_EOL;
        // end select --------------------------------------------------------------
        $f .= '</div>' . PHP_EOL;
    }
    $disabled = $ROOT || ($user['role_id'] != 1 || $self) ? null : ' disabled="disabled"';
    // diplay login
    if ($user === null) {
        $f .= '<div class="fl mr">' . PHP_EOL;
        $f .= '<label for="login' . $rnd . '">login</label>' . PHP_EOL;
        $f .= '<input type="text" id="login' . $rnd . '" name="login" class="text block"' . $disabled . ' />' . PHP_EOL;
        $f .= '</div>' . PHP_EOL;
    }
    // common fields
    $f .= '<div class="fl mr">' . PHP_EOL;
    $f .= '<label for="name' . $rnd . '">full name</label>' . PHP_EOL;
    $f .= '<input type="text" id="name' . $rnd . '" name="name" class="text block"' . $disabled . ' value="' . $user['name'] . '" />' . PHP_EOL;
    $f .= '</div>' . PHP_EOL;
    $f .= '<div class="fl mr">' . PHP_EOL;
    $f .= '<label for="email' . $rnd . '">email</label>' . PHP_EOL;
    $f .= '<input type="text" id="email' . $rnd . '" name="email" class="text block"' . $disabled . ' value="' . $user['email'] . '" />' . PHP_EOL;
    $f .= '</div>' . PHP_EOL;
    $f .= '<div class="fl mr">' . PHP_EOL;
    $f .= '<label for="website' . $rnd . '">website</label>' . PHP_EOL;
    $f .= '<input type="text" id="website' . $rnd . '" name="website" class="text block"' . $disabled . ' value="' . $user['website'] . '" />' . PHP_EOL;
    $f .= '</div>' . PHP_EOL;
    // user password prefix
    $display = $user === null ? "set" : "change";
    $f .= '<div class="fl mr">' . PHP_EOL;
    $f .= '<label for="pass1' . $rnd . '">' . $display . ' password</label>' . PHP_EOL;
    $f .= '<input type="password" id="pass1' . $rnd . '" name="pass1" class="text block"' . $disabled . ' />' . PHP_EOL;
    $f .= '</div>' . PHP_EOL;
    // password must be verified
    $f .= '<div class="fl mr">' . PHP_EOL;
    $f .= '<label for="pass2' . $rnd . '">retype password</label>' . PHP_EOL;
    $f .= '<input type="password" id="pass2' . $rnd . '" name="pass2" class="text block"' . $disabled . ' />' . PHP_EOL;
    $f .= '</div>' . PHP_EOL;
    $f .= '</fieldset>' . PHP_EOL;
    // float right
    $f .= '<div class="fr">' . PHP_EOL;
    $form = $user === null ? "create" : "manage";
    $f .= '<input type="hidden" name="form" value="' . $form . '" />' . PHP_EOL;
    // override user login if admin is going to update
    if ($user !== null) {
        $f .= '<input type="hidden" name="login" value="' . $user['login'] . '" />' . PHP_EOL;
    }
    $display = $user === null ? "Create" : "Update";
    $f .= '<input type="submit" class="button round"' . $disabled . ' value="' . $display . '" />' . PHP_EOL;
    $f .= '</div>' . PHP_EOL;
    $f .= '</form>' . PHP_EOL;
    // the superadmin user cannot delete itself
    if (is_root() && !$self && $user !== null) {
        $f .= '<form action="saveaccount.php" method="post">' . PHP_EOL;
        $f .= '<div class="fr">' . PHP_EOL;
        $f .= '<input type="hidden" name="login" value="' . $user['login'] . '" />' . PHP_EOL;
        $f .= '<input type="hidden" name="form" value="delete" />' . PHP_EOL;
        $f .= '<input type="submit" class="button round delete conf" value="Delete" />' . PHP_EOL;
        $f .= '</div>' . PHP_EOL;
        $f .= '</form>' . PHP_EOL;
    }
    // insert a small padding
    $f .= '<p class="clear"></p>' . PHP_EOL;
    if ($isAdmin) {
        $f .= '</div><!-- end wrapper -->' . PHP_EOL;
    }
    return $f;
}
Ejemplo n.º 23
0
 function ShowRecipients()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core_file('table.lib');
     $ret['thisname'] = $this->name;
     $ret['table'] = table(array('from' => "clients", 'columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'CONCAT(cont_name,CHAR(32),cont_lname)', 'display' => 'client', 'flags' => FLAG_SEARCH), array('select' => 'email', 'display' => 'email', 'flags' => FLAG_SEARCH), array('select' => 'reg_date', 'display' => 'registered', 'align' => 'right', 'type' => 'registered')), 'where' => 'visible=1 AND LENGTH(email)>0 ' . (is_root() ? '' : 'AND (admin_id IS NULL OR admin_id IN (' . join(',', $this->user['subst']) . '))'), 'orderby' => 'id', 'params' => array('page' => $this->name, 'do' => 'showrecipients'), 'click' => 'ID=cb.value;', 'dblclick' => 'PasteRecipients(id)'), $this);
     return Parse($ret, $this->name . '.recipients.tmpl');
 }
Ejemplo n.º 24
0
<body>

<div id="global">

<h1><strong>smt2</strong> installer</h1>

<?php 
$cnx = db_connect();
// is already installed?
if (mysql_query("DESCRIBE " . TBL_PREFIX . TBL_RECORDS, $cnx)) {
    ?>

  <h3 class="ko">smt2 is already installed</h3>
  <?php 
    // help the root user to unistall smt2 stuff
    $msg = is_root() ? 'use <a href="uninstall.php">this script</a>' : 'please delete all <em>' . TBL_PREFIX . '</em> tables from database';
    ?>
  <p>
    If you want to re-install it, <?php 
    echo $msg;
    ?>
.
  </p>
  
<?php 
} else {
    // before installing, ask user email (will be inserted on DB)
    if (isset($_POST['email'])) {
        $email = trim($_POST['email']);
    }
    // however, it can be changed later, so it won't be validated
Ejemplo n.º 25
0
Archivo: list.php Proyecto: Simo22/smt2
    $list .= '<tbody>';
    foreach ($notes as $note) {
        $user = db_select(TBL_PREFIX . TBL_USERS, "login", "id='" . $note['uid'] . "'");
        // build row
        $list .= '<tr>';
        $list .= '<td>' . $user['login'] . '</td>';
        $qs = array('id' => $id, 'start' => $note['pos']);
        $list .= '<td><a href="../track.php?' . http_build_query($qs) . '" class="track">' . $note['pos'] . '</a></td>';
        $list .= '<td>' . trim_text(strip_tags($note['txt']), 10) . '</td>';
        $list .= '<td>';
        $qs = array('id' => $id, 'login' => $user['login'], 'time' => $note['pos']);
        $list .= '<a href="read.php?' . http_build_query($qs) . '">read</a>';
        if ($_SESSION['login'] == $user['login'] || is_admin()) {
            $list .= ' | <a href="edit.php?' . http_build_query($qs) . '">edit</a>';
        }
        if (is_root()) {
            $list .= ' | <a class="conf" href="delete.php?' . http_build_query($qs) . '">delete</a>';
        }
        $list .= '</td>';
        $list .= '</tr>';
    }
    $list .= '</tbody>';
    $list .= '</table>';
    echo $list;
} else {
    echo "No hypernotes were found for this movie.";
}
?>

<script type="text/javascript">
$(function() {
Ejemplo n.º 26
0
	MIT License
	(c) 2013 Marcin Szczyglinski
	szczyglis83@gmail.com
	GitHUB: https://github.com/phpos/
	File version: 1.0.0, 2013.10.08
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
if (APP_ACTION == 'index') {
    switch ($my_app->get_param('fs')) {
        case 'local_files':
            $html['right_items_title'] = txt('explorer_right_local');
            if (!$readonly || is_root()) {
                $html['right_items_desc'] = txt('explorer_right_local_desc_drag_active');
            } else {
                $html['right_items_desc'] = '<span style="color:#7f1f1d">' . txt('readonly_right_msg') . '</span>';
            }
            $html['right_items_img'] = 'hdd.png';
            break;
        case 'db_mysql':
            $html['right_items_title'] = txt('explorer_right_db');
            $html['right_items_desc'] = txt('explorer_right_db_desc');
            $html['right_items_img'] = 'db.png';
            break;
        case 'ftp':
            $html['right_items_title'] = txt('explorer_right_ftp');
            $html['right_items_desc'] = $ftp_connect_status . txt('explorer_right_local_desc_drag_active');
            $html['right_items_img'] = 'ftp.png';
            msg::error(txt('access_denied'));
        }
    } else {
        $my_app->set_param('action_status', 'error');
        $my_app->set_param('action_status_msg', txt('access_denied'));
        cache_param('action_status');
        cache_param('action_status_msg');
        msg::error(txt('access_denied'));
    }
    unset($_FILES);
}
/*
**************************
*/
//echo $_SESSION['ftp'].'<br>';
if (globalconfig('demo_mode') != 1 || is_root()) {
    if (form_submit('new_rename')) {
        if ($readonly != 1) {
            if ($phposFS->rename(strip_tags($_POST['edit_id']), filter::fname($_POST['new_folder_name']))) {
                $my_app->set_param('action_status', 'ok');
                $my_app->set_param('action_status_msg', txt('renamed'));
                cache_param('action_status');
                cache_param('action_status_msg');
                msg::ok($txt('updated'));
            }
        } else {
            $my_app->set_param('action_status', 'error');
            $my_app->set_param('action_status_msg', txt('access_denied'));
            cache_param('action_status');
            cache_param('action_status_msg');
            msg::error($txt('access_denied'));
Ejemplo n.º 28
0
             helper_result('new_ftp_result', 'result', 'success');
             helper_result('new_ftp_id', 'var', 1);
             savelog('FTP_ACCOUNT_CREATE#SUCCESS');
         } else {
             savelog('FTP_ACCOUNT_CREATE#FAILED');
             helper_result('new_ftp_result', 'result', 'error');
             helper_result('new_ftp', 'error', txt('error'));
         }
         $_POST['action'] = null;
     }
 }
 // update
 if (form_submit('update_ftp')) {
     if ($_POST['action'] == 'update_ftp') {
         $ftp = new phpos_ftp();
         if ($ftp->is_my_ftp($ftp_id) || is_root() || is_admin()) {
             $tmp_title = strip_tags($_POST['ftp_new_title']);
             $tmp_desc = strip_tags($_POST['ftp_new_desc']);
             $tmp_host = strip_tags($_POST['ftp_new_host']);
             $tmp_login = strip_tags($_POST['ftp_new_login']);
             $tmp_pass = strip_tags($_POST['ftp_new_pass']);
             $tmp_port = strip_tags($_POST['ftp_new_port']);
             $tmp_public = strip_tags($_POST['ftp_new_public']);
             $ftp->set_id($ftp_id);
             if ($ftp->update_ftp($ftp_id, $tmp_title, $tmp_desc, $tmp_host, $tmp_login, $tmp_pass, $tmp_port, $tmp_public, null)) {
                 helper_result('update_ftp', 'ok', txt('updated'));
                 helper_result('update_ftp_result', 'result', 'success');
                 helper_result('update_ftp_id', 'var', 1);
                 savelog('FTP_ACCOUNT_UPDATE_ID_' . $ftp_id . '#SUCCESS');
             } else {
                 helper_result('update_ftp_result', 'result', 'error');
Ejemplo n.º 29
0
    case 'local_files':
        $contextMenus['FILE'] = array('open::' . txt('open') . '::explorer_open_in_browser("' . $icons[$i]['id'] . '");::folder_open', '---', 'open_with::' . txt('open_with') . '::alert();::icon', array('openwith1::' . txt('in_web_browser') . '::explorer_open_in_browser("' . $icons[$i]['id'] . '");'));
        if (!$readonly || is_root()) {
            $contextMenus['FILE'][] = '---';
            $contextMenus['FILE'][] = 'rename::' . txt('rename') . '::' . winmodal(txt('rename'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',dir_id:' . $context_dir_id . ',edit_id:' . base64_encode($icons[$i]['id']) . ',old_name:' . base64_encode($icons[$i]['basename']) . ',after_reload:' . WIN_ID) . '::edit';
        }
        $contextMenus['FILE'][] = '---';
        $contextMenus['FILE'][] = 'download::' . txt('download') . '::' . browser_url(PHPOS_WEBROOT_URL . 'phpos_downloader.php?hash=' . md5(PHPOS_KEY) . '&download_type=' . base64_encode('local_file') . '&file=' . base64_encode(str_replace(PHPOS_WEBROOT_DIR, '', $icons[$i]['id']))) . '::download';
        $contextMenus['DIR'] = array('open::' . txt('open') . '::alert("normalopen' . $item . '");::folder_open', 'open_with::' . txt('open_with') . '::alert();::icon', array('openwith1::' . txt('in_new_win') . '::explorer_open_in_browser("' . $icons[$i]['id'] . '");'));
        if (!$readonly || is_root()) {
            $contextMenus['DIR'][] = '---';
            $contextMenus['DIR'][] = 'rename::' . txt('rename') . '::' . winmodal(txt('rename'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',dir_id:' . $context_dir_id . ',edit_id:' . base64_encode($icons[$i]['id']) . ',old_name:' . base64_encode($icons[$i]['basename']) . ',after_reload:' . WIN_ID) . '::edit';
        }
        if (!$readonly || is_root()) {
            $contextMenus['WINDOW'][] = 'newfolder::' . txt('new_folder') . '::' . winmodal(txt('new_folder'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',back:null, dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID) . '::folder_files';
            if (globalconfig('disable_upload') != 1 || is_root()) {
                $contextMenus['WINDOW'][] = 'upload::' . txt('upload_here') . '::' . winmodal('Nowa ikona', 'app', 'app_id:shortcuts@upload,width:300,height:350', 'desktop:1,location:' . $context_location . ',back:null,dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID) . '::disk';
            }
        } else {
            $contextMenus['WINDOW'] = array('read::This folder is readonly::;::login');
        }
        break;
    case 'ftp':
        $contextMenus['FILE'] = array('open::' . txt('open') . '::explorer_ftp_view("' . $icons[$i]['id'] . '", "' . $icons[$i]['basename'] . '", "' . $my_app->get_param('fs') . '");::folder_open', '---', 'download::' . txt('download') . '::explorer_ftp_download("' . $icons[$i]['id'] . '", "' . $icons[$i]['basename'] . '", "' . $my_app->get_param('fs') . '");::download', '---', 'rename::' . txt('rename') . '::' . winmodal(txt('rename'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',dir_id:' . $context_dir_id . ',action_id:null,edit_id:' . base64_encode($icons[$i]['id']) . ',old_name:' . base64_encode($icons[$i]['basename']) . ',after_reload:' . WIN_ID) . '::edit');
        $contextMenus['DIR'] = array('open::' . txt('open') . '::alert("normalopen' . $item . '");::folder_open', '---', 'rename::' . txt('rename') . '::' . winmodal(txt('rename'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',dir_id:' . $context_dir_id . ',action_id:null,edit_id:' . base64_encode($icons[$i]['id']) . ',old_name:' . base64_encode($icons[$i]['basename']) . ',after_reload:' . WIN_ID) . '::edit');
        $contextMenus['WINDOW'] = array('newfolder::' . txt('new_folder') . '::' . winmodal(txt('new_folder'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',back:null, dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID) . '::folder_files', 'upload::' . txt('upload_here') . '::' . winmodal('Nowa ikona', 'app', 'app_id:shortcuts@upload,width:300,height:350', 'desktop:1,location:' . $context_location . ',back:null,dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID) . '::disk');
        break;
}
if (APP_ACTION == 'desktop') {
    //$contextMenus['WINDOW'][] = '---';
    $contextMenus['WINDOW'][] = 'wallpaper::' . txt('change_desktop_wallpaper') . '::' . winopen(txt('account_settings'), 'cp', 'app_id:users@index', 'section:wallpapers') . '::application';
Ejemplo n.º 30
0
} else {
    echo $layout->txtdesc(txt('dsc_ftp_list_public_user'));
}
$ftp = new phpos_ftp();
$ftp_ids = $ftp->get_public_ftp();
$c = count($ftp_ids);
if ($c != 0) {
    echo $layout->tbl_start();
    $layout->td_classes(array('', '', 'tbl_grey'));
    echo $layout->head(array('<img src="' . ICONS . 'server/ftp.png" />' => '20%', txt('ftp_account') => '40%', 'Host' => '40%'));
    for ($i = 0; $i < $c; $i++) {
        $f = new phpos_ftp();
        $f->set_id($ftp_ids[$i]['id']);
        $f->get_ftp();
        //$usr_count = $f->count_users();
        $u = new phpos_users();
        $u->set_id_user($group_ids[$i]['id_owner']);
        $u->get_user_by_id();
        if (is_root() || $f->is_my($ftp_ids[$i]['id'])) {
            $item = '<a href="javascript:void(0);" onclick="' . helper_reload(array('section' => 'edit_account', 'ftp_id' => $f->get_id())) . '">' . $f->get_title() . '</a>';
        } else {
            $item = $f->get_title();
        }
        echo $layout->row(array('<img src="' . ICONS . 'server/ftp.png"  style="height:20px"/>', $item, $f->get_host()), $f->get_desc());
    }
    echo $layout->tbl_end();
} else {
    echo $layout->empty_list();
}
echo $layout->end('column');
echo $layout->clr();