Esempio n. 1
0
 function chkLogin()
 {
     $u = $_POST['username'];
     if (!data_exists("user/{$u}/pwd")) {
         return LANG('No such user');
     }
     $p = password($_POST['password']);
     if ($p != data_read("user/{$u}/pwd")) {
         return LANG('Password wrong');
     }
     $_SESSION[USER_SESSION] = $u;
     return false;
 }
Esempio n. 2
0
 function checkPwd()
 {
     if (!isset($_POST['password'][2])) {
         return LANG('Password must be at least 3 charaters long');
     }
     if ($_POST['password'] !== $_POST['retype']) {
         return LANG('Password retype doesn\'t match');
     }
     $p = password($_POST['password']);
     $u = user('id');
     data_save("user/{$u}/pwd", $p);
     return false;
 }
Esempio n. 3
0
 function chkRegister()
 {
     if (!preg_match('/^[0-9a-zA-Z_]+$/', $_POST['username'])) {
         return LANG('Username must only contain English alphabets, underscore and numbers');
     }
     $u = $_POST['username'];
     if (data_exists("user/{$u}/pwd")) {
         return LANG('User exists');
     }
     if (!isset($_POST['password'][2])) {
         return LANG('Password must be at least 3 charaters long');
     }
     if ($_POST['password'] != $_POST['retype']) {
         return LANG('Password retype doesn\'t match');
     }
     $p = password($_POST['password']);
     data_save("user/{$u}/pwd", $p);
     $_SESSION[USER_SESSION] = $u;
 }
Esempio n. 4
0
 public function GetHtml()
 {
     $out = '<div class="page-navigation">';
     $total = $this->TotalPages();
     if ($total > 1) {
         if ($this->HasPrevPage()) {
             $out .= ' <a href="#URL#' . $this->PrevPage() . '">←&nbsp;' . LANG('PAGINATOR_PREV') . '</a> ';
         }
         for ($n = 1; $n <= $total; $n++) {
             if ($n == $this->currentPage) {
                 $out .= ' <a href="#URL#' . $n . '" class="active">' . $n . '</a> ';
             } else {
                 $out .= ' <a href="#URL#' . $n . '">' . $n . '</a> ';
             }
         }
         if ($this->HasNextPage()) {
             $out .= ' <a href="#URL#' . $this->NextPage() . '">' . LANG('PAGINATOR_NEXT') . '&nbsp;→</a> ';
         }
     }
     $out .= '</div>';
     return $out;
 }
Esempio n. 5
0
if (!defined("KERNEL_INCLUDED") || KERNEL_INCLUDED !== true) {
    die;
}
if (!empty($arResult) and !empty($arParams["SHOW_FIELDS"])) {
    $arDecorate = array("LOGIN" => '<a href="/scriptacid/admin/users/user.php?ID=#ID#">#LOGIN#</a>');
    ?>
	<table>
		<thead>
			<tr>
			<?php 
    foreach ($arParams["SHOW_FIELDS"] as $field) {
        ?>
				<th>
					<?php 
        echo LANG('SYTEM_USER_' . $field);
        ?>
				</th>
			<?php 
    }
    ?>
			</tr>
		</thead>
		<?php 
    foreach ($arResult['USERS'] as $n => $arItem) {
        ?>
			<tr <?php 
        echo $n % 2 ? 'class="altrow"' : '';
        ?>
>
				<?php 
Esempio n. 6
0
        } else {
            $o = array();
        }
        $c = iescape($_POST['content']);
        $lines = explode("\n", $c);
        $t = $lines[0];
        unset($lines[0]);
        $c = implode('</br>', $lines);
        $o[] = array('title' => $t, 'content' => $c, 'user' => user('id'));
        data_save($dataitem, json_encode($o));
        post_status(LANG('modify the calendar at %%', $_POST['date']));
    }
} elseif ($_GET['action'] == 'delete') {
    if (user() && user('verified') && posted('date', 'key')) {
        $dataitem = 'calendar/' . $_POST['date'];
        if (data_exists($dataitem)) {
            $o = json_decode(data_read($dataitem), true);
        } else {
            $o = array();
        }
        if (isset($o[$_POST['key']])) {
            unset($o[$_POST['key']]);
        }
        if (count($o) <= 0) {
            data_remove($dataitem);
        } else {
            data_save($dataitem, json_encode($o));
        }
        post_status(LANG('modify the calendar at %%', $_POST['date']));
    }
}
Esempio n. 7
0
                // checkbox radio select file
        }
        ?>
					</td>
				</tr>
			<?php 
    }
    ?>
			</table>
		</div>
		<div id="personal">
			<table width="100%">
				<tr>
					<td>
						<b><?php 
    echo LANG('SYTEM_USER_LOGIN');
    ?>
:</b>
					</td>
					<td>
						<input type="text" name="LOGIN" value="<?php 
    echo $arUser["LOGIN"];
    ?>
" />
					</td>
				</tr>
			</table>
		</div>
		<div id="groups">
			<table class="form-table">
				<?php 
Esempio n. 8
0
		<?php 
                break;
                ?>
		<?php 
            default:
                ?>
		<h3><?php 
                echo LANG("MODULE_CATALOG_TYPES_TITLE");
                ?>
</h3>
		<?php 
                ShowMsg();
                ?>
		<p>
			<a href="?ACTION=ADD"><?php 
                echo LANG("MODULE_CATALOG_TYPES_ADD_TEXT");
                ?>
</a>
		</p>
		<?php 
                App::callComponent("system:catalog.type.list", "_admin", array("SHOW_FIELDS" => array("ID", "NAME", "SORT", "SID", "SECTION_NAME", "ELEMENT_NAME")));
                ?>
		<?php 
                break;
                ?>
	<?php 
        }
    }
    ?>

<?php 
Esempio n. 9
0
?>
</div>
	<div class="form-table-buttons">
		<?php 
if ($arResult["MODE"] == "ADD") {
    ?>
			<input type="submit" class="button" name="add_btn" value="<?php 
    echo LANG('MODULE_CATALOG_ELEMENTS_ADD_TEXT');
    ?>
"/>&nbsp;
		<?php 
} else {
    ?>
			<input type="submit" class="button" name="edit_btn" value="<?php 
    echo LANG('MODULE_CATALOG_ELEMENTS_EDIT_TEXT');
    ?>
"/>&nbsp;
			<input type="submit" class="button" name="apply_btn" value="<?php 
    echo LANG('MODULE_CATALOG_ELEMENTS_APPLY_TEXT');
    ?>
"/>&nbsp;
		<?php 
}
?>
		<button class="button" onClick="return RedirectTo('/admin/catalog/')"><?php 
echo LANG('MODULE_CATALOG_ELEMENTS_CANCEL_TEXT');
?>
</button>
	</div>
</div>
</form><?php 
Esempio n. 10
0
		<p></p>
		<b>Loose Stock</b><br />
		If you are using only one location and a loose stock without palettes, you can simply select the category where you want to add/remove items to/from.
		Be awaware, that you can only add/remove items from categories, that didn't contain subcategories.
		<p></p>
		Select if the item is for male, female, baby persons (or none of them) and if you estimated the amount of items.
		You can select/deselect any of these options by clicking the corressponding button. Enter the number of items you want to add
		into <i><?php 
print LANG('income');
?>
</i> input field and the number of items you want to remove into <i><?php 
print LANG('outgo');
?>
</i> input field.
		Press the enter key or click <i><?php 
print LANG('add_to_loose_stock');
?>
</i>.
		<p></p>
		You selection for category, male, female, baby, estimated and income or outgo is saved and you can directly enter a new number for your last selected input field, if you want to.<br />
		Select the category name above the form to go up inside the category tree.
		<p></p>
		
		<b>Stock at location and/or palette</b><br />
		You can also select a location and/or palette by clicking on the location and/or palette at the locations/palettes overview.
		Than you're adding your items only at this particular location/palette.
	</div>
	
	<div>
		<h1>Terms of use</h1>
		Charity organisations that are working without profit can use this service for free.<br />
Esempio n. 11
0
}
if (isset($qpath)) {
    if (isset($qpath[1])) {
        unset($qpath[count($qpath) - 1]);
        $parent = implode('/', $qpath);
    } else {
        $parent = '';
    }
    $index = data_list("wiki/{$parent}", 'wiki_');
    foreach ($index as $k => &$v) {
        $v = array('path' => substr(str_replace('/wiki_', '/', $k), 5), 'name' => $v, 'child' => array(), 'active' => false);
        if ($v['path'] == $pquery) {
            $v['child'] = $childs;
            $v['active'] = true;
        }
    }
    if (isset($parent[0])) {
        $name = substr($qpath[count($qpath) - 1], 5);
        $index = array(array('path' => substr(str_replace('/wiki_', '/', $parent), 5), 'name' => $name, 'child' => $index, 'active' => false));
    }
} else {
    $index = $childs;
}
$content = data_read("wiki/{$query}/content");
if (!user('verified')) {
    $content = preg_replace('/\\{\\{\\{.*?\\}\\}\\}/s', '<span class="verified-only">' . LANG('Visible to verified user only') . '</span>', $content);
} elseif (!isset($_GET['edit'])) {
    $content = preg_replace('/\\{\\{\\{(.*?)\\}\\}\\}/s', '$1', $content);
}
$data = array('query' => $pquery, 'title' => $title, 'path' => $path, 'index' => $index, 'content' => $content, 'isedit' => isset($_GET['edit']), 'attachments' => json_decode(data_read("wiki/{$query}/attachments"), true));
die(tpl('wiki', $data));
Esempio n. 12
0
            ?>
&CATALOG_ID=<?php 
            echo sXss($_GET['CATALOG_ID']);
            ?>
"><?php 
            echo LANG("MODULE_CATALOG_ELEMENTS_ADD_TEXT");
            ?>
</a>&nbsp;&nbsp;&nbsp;
		<a href="?ACTION=ADD_SECTION&TYPE=<?php 
            echo sXss($_GET['TYPE']);
            ?>
&CATALOG_ID=<?php 
            echo sXss($_GET['CATALOG_ID']);
            ?>
"><?php 
            echo LANG("MODULE_CATALOG_SECTION_ADD_TEXT");
            ?>
</a>
	</p>
	<?php 
            Component::callComponent(":catalog.section.list", "_admin", array("SECTION_ID" => $_GET["SECTION_ID"], "CATALOG_ID" => $_GET["CATALOG_ID"], "=CATALOG_TYPE" => $_GET["TYPE"], "FIELDS" => array("ID", "ACTIVE", "NAME", "CATALOG_SECTION_ID", "CATALOG_ID", "SORT", "CODE", "PREVIEW_PICTURE", "PREVIEW_TEXT", "PREVIEW_TEXT_TYPE", "DETAIL_PICTURE", "DETAIL_TEXT", "DETAIL_TEXT_TYPE", "TAGS")));
            ?>
	<?php 
            Component::callComponent(":catalog.section", "_admin", array("CATALOG_TYPE" => $_GET["TYPE"], "CATALOG_ID" => intVal($_GET["CATALOG_ID"]), "=SECTION_ID" => $_GET["SECTION_ID"]));
            ?>
	<?php 
            break;
    }
    ?>

<p>
Esempio n. 13
0
    echo $parentID;
    ?>
">Вверх</a>
	</span>
<?php 
}
?>
	<table>
		<thead>
			<tr>
			<?php 
foreach ($arParams["FIELDS"] as $field) {
    ?>
				<th>
					<?php 
    echo LANG('MODULE_CATALOG_ELEMENTS_' . $field);
    ?>
				</th>
			<?php 
}
?>
				<th>&nbsp;</th>
			</tr>
		</thead>
<?php 
if (!empty($arResult["ITEMS"]) and !empty($arParams["SHOW_FIELDS"])) {
    ?>
		<?php 
    foreach ($arResult["ITEMS"] as $n => $arItem) {
        ?>
			<tr <?php 
Esempio n. 14
0
		</table>
	</div>
	<div class="form-table-buttons">
		<?php 
if ($arResult["MODE"] == "ADD") {
    ?>
			<input type="submit" class="button" name="add_btn" value="<?php 
    echo LANG('MODULE_CATALOG_ADD_TEXT');
    ?>
"/>&nbsp;
		<?php 
} else {
    ?>
			<input type="submit" class="button" name="edit_btn" value="<?php 
    echo LANG('MODULE_CATALOG_EDIT_TEXT');
    ?>
"/>&nbsp;
			<input type="submit" class="button" name="apply_btn" value="<?php 
    echo LANG('MODULE_CATALOG_APPLY_TEXT');
    ?>
"/>&nbsp;
		<?php 
}
?>
		<button class="button" onClick="return RedirectTo('/scriptacid/admin/catalog/')"><?php 
echo LANG('MODULE_CATALOG_CANCEL_TEXT');
?>
</button>
	</div>
</div>
</form><?php 
Esempio n. 15
0
function getUser($u)
{
    if (data_exists("user/{$u}/pwd")) {
        $id = $u;
        if (!data_exists("user/{$u}/info")) {
            $u = array('name' => $u, 'title' => LANG('Unidentified'), 'verified' => false);
        } else {
            $u = json_decode(data_read("user/{$u}/info"), true);
        }
        $u['id'] = $id;
        if (file_exists("data/user/{$id}/avatar.jpg")) {
            $u['avatar'] = BASE . "data/user/{$id}/avatar.jpg";
        } else {
            $u['avatar'] = BASE . 'res/images/default-avatar.jpg';
        }
        return $u;
    }
    return NULL;
}
Esempio n. 16
0
namespace ScriptAcid;

if (!defined("KERNEL_INCLUDED") || KERNEL_INCLUDED !== true) {
    die;
}
if (!Modules::includeModule('catalog')) {
    ShowError("Модуль каталогов не установлен.");
    return;
}
$arParams['BTN_NAME'] = strlen($arParams['BTN_NAME']) > 0 ? $arParams['BTN_NAME'] : 'add_btn';
$arParams['ADD_BTN_NAME'] = strlen($arParams['ADD_BTN_NAME']) > 0 ? $arParams['ADD_BTN_NAME'] : LANG('ADD_BTN');
$arParams['EDIT_BTN_NAME'] = strlen($arParams['EDIT_BTN_NAME']) > 0 ? $arParams['EDIT_BTN_NAME'] : LANG('EDIT_BTN');
$arParams['CATALOG_ID'] = intVal($arParams['CATALOG_ID']) > 0 ? intVal($arParams['CATALOG_ID']) : false;
$arParams['USE_CAPTCHA'] = $arParams['USE_CAPTCHA'] == "Y" ? "Y" : "N";
$arParams['MSG_ADD'] = strLen($arParams['MSG_ADD']) > 0 ? $arParams['MSG_ADD'] : LANG('MSG_ADD');
$arParams['MSG_EDIT'] = strLen($arParams['MSG_EDIT']) > 0 ? $arParams['MSG_EDIT'] : LANG('MSG_EDIT');
$arParams['PREVIEW_TEXT_LENGTH'] = intVal($arParams['PREVIEW_TEXT_LENGTH']) > 0 ? intVal($arParams['PREVIEW_TEXT_LENGTH']) : 80;
$arParams["ID"] = intVal($arParams["ID"]) > 0 ? intVal($arParams["ID"]) : 0;
$arCatalog['PROPERTIES'] = Catalog::GetCatalogProperties($arParams['CATALOG_ID']);
$arFields = CatalogUtils::GetMainFieldsArray();
if (!empty($arCatalog['PROPERTIES'])) {
    foreach ($arCatalog['PROPERTIES'] as $arProp) {
        $arFields[$arProp['ID']] = array("NAME" => $arProp['NAME'], "CODE" => $arProp['CODE'], "TYPE" => $arProp['PROPERTY_TYPE'], "MULTIPLE" => $arProp['MULTIPLE'], "DEFAULT" => $arProp['DEFAULT_VALUE']);
    }
}
$arResult['FIELDS'] = $arFields;
// SECTION TREE
$arSectionTree = array('' => array('NAME' => 'Корневой каталог'));
$rsec = CatalogSection::GetList(array("NAME" => "ASC"), array("CATALOG_ID" => $arParams['CATALOG_ID']));
while ($obSec = $rsec->GetNextElement()) {
    $arSec = $obSec->GetFields();
Esempio n. 17
0
}
?>
	
	<div class="form-table-buttons">
		<?php 
if ($arResult["MODE"] == "ADD") {
    ?>
			<input type="submit" class="button" name="add_btn" value="<?php 
    echo LANG('MODULE_CATALOG_ELEMENTS_ADD_TEXT');
    ?>
"/>&nbsp;
		<?php 
} else {
    ?>
			<input type="submit" class="button" name="edit_btn" value="<?php 
    echo LANG('MODULE_CATALOG_ELEMENTS_EDIT_TEXT');
    ?>
"/>&nbsp;
			<input type="submit" class="button" name="apply_btn" value="<?php 
    echo LANG('MODULE_CATALOG_ELEMENTS_APPLY_TEXT');
    ?>
"/>&nbsp;
		<?php 
}
?>
		<?php 
/*/?><button class="button" onClick="return RedirectTo('/scriptacid/admin/catalog/')"><?php echo LANG('MODULE_CATALOG_ELEMENTS_CANCEL_TEXT')?></button><?php  //*/
?>
	</div>
</div>
</form><?php 
Esempio n. 18
0
			<td class="td-right">
				<?php 
    if ($arResult["MODE"] == "ADD") {
        ?>
					<input type="submit" class="button" name="add_btn" value="<?php 
        echo LANG('CATALOG_TYPE_ADD_TEXT');
        ?>
"/>&nbsp;
				<?php 
    } else {
        ?>
					<input type="submit" class="button" name="edit_btn" value="<?php 
        echo LANG('CATALOG_TYPE_EDIT_TEXT');
        ?>
"/>&nbsp;
				<?php 
    }
    ?>
				<button class="button" onClick="return RedirectTo(<?php 
    echo SYS_ROOT;
    ?>
'/admin/catalog/')"><?php 
    echo LANG('CATALOG_TYPE_CANCEL_TEXT');
    ?>
</button>
			</td>
		</tr>
	</table>
</form>
<?php 
}
Esempio n. 19
0
<?php

namespace ScriptAcid;

if (!defined("KERNEL_INCLUDED") || KERNEL_INCLUDED !== true) {
    die;
}
?>
<br />
<?php 
//d($arResult)
?>
<b><?php 
echo LANG("NAVIGATION");
?>
</b>: 
<?php 
foreach ($arResult["ITEMS"] as $arItem) {
    ?>
   <a href="<?php 
    echo $arItem["URL"];
    ?>
" title="<?php 
    echo $arItem["NAME"];
    ?>
" style="color:red"><?php 
    echo $arItem["NAME"];
    ?>
</a>&nbsp;&nbsp;
<?php 
}
Esempio n. 20
0
	<div><span class="group_left"><img src="img/logo-48.png" /> Social Warehouse</span>
	<!--  <a href="lang/<?php 
print HELP_FILE();
?>
" target="_blanc" class="button table_cell smalltext lightgray">
		<?php 
print LANG('help');
?>
	</a>--></div>
	<div id="menu"></div>
</div>

<div class="mainframe">
	
	<div id="loading" class="centertext tinytext"><img src="img/loading.gif" /> <?php 
print LANG('loading');
?>
</div>
	<div id="content"></div>
	
	<div class="footer">
		Social Warehouse, published under <a href="http://www.gnu.org/licenses/gpl-3.0.txt" target="_blanc">GPLv3</a> by <a href="http://www.hanneseilers.de">Hannes Eilers</a>
	</div>
</div>

<div id="overlay" class="overlay">
	<div class="overlay_main">
		<div id="overlay_content"></div>
		<div class="hspacer"></div>
		<div id="overlay_buttons"></div>
	</div>
Esempio n. 21
0
function list_status($start = NULL, $limit = 50)
{
    $last = last_post_id();
    if ($limit > 0) {
        if (!$start) {
            $start = $last + 1;
        }
        $step = -1;
    } else {
        $limit = -$limit;
        if (!$start) {
            $start = $last - $limit;
        }
        if ($start < 0) {
            $start = 0;
        }
        $n = $last - $start;
        if ($limit > $n) {
            $limit = $n;
        }
        $step = 1;
    }
    $start += $step;
    $ret = array();
    $id = $start;
    while ($limit > 0 && $id > 0 && $id <= $last) {
        if (data_exists("status/post_{$id}")) {
            $item = json_decode(data_read("status/post_{$id}"), true);
            $item['id'] = $id;
            $item['type_lang'] = LANG($item['type']);
            $item['human_time'] = human_time($item['date']);
            $ret[] = $item;
            $limit--;
        }
        $id += $step;
    }
    if ($step > 0) {
        $ret = array_reverse($ret);
    }
    return $ret;
}
Esempio n. 22
0
        ?>
		<tr>
			<td valign="top">
				<?php 
        $LABEL = isset($arParams['CUSTOM_LABEL_' . $FID]) ? $arParams['CUSTOM_LABEL_' . $FID] : '';
        ?>
				<?php 
        if (!empty($LABEL)) {
            echo $LABEL;
            echo in_array($FID, $arParams['REQUIRED']) ? '<span class="required">*</span>' : '';
            ?>
:<?php 
        } else {
            ?>
					<?php 
            echo is_numeric($FID) ? $arField['NAME'] : LANG('CATALOG_ELEMENT_ADD_LABEL_' . $FID);
            echo in_array($FID, $arParams['REQUIRED']) ? '<span class="required">*</span>' : '';
            ?>
:
				<?php 
        }
        ?>
			</td>
		<?php 
        if (!is_numeric($FID)) {
            ?>
			<td><?php 
            switch ($FID) {
                case 'CATALOG_SECTION_ID':
                    $value = $_POST[$FID];
                    ?>
Esempio n. 23
0
        echo User::GetSign($arItem["CREATED_BY"]);
        ?>
,&nbsp;
					<strong><?php 
        echo LANG('ADD_DATE');
        ?>
 </strong> <?php 
        echo $arItem["DATE_CREATE"];
        ?>
				</p>
			</td>
		</tr>
	<?php 
    }
    ?>
	</table>
<p>
	<?php 
    echo str_replace('#URL#', GetCurPage() . '?PAGE=', $arResult['PAGINATION']);
    ?>
</p>
</div>
<?php 
} else {
    ?>
	<p><?php 
    echo LANG('NO_RESULT_TEXT');
    ?>
</p>
<?php 
}
Esempio n. 24
0
<!DOCTYPE html>
<?php 
// include multilanguage support
include "lang/lang.php";
// load classloader
include_once 'api/classloader.php';
?>

<html>
<head>
<meta charset="UTF-8">
<title><?php 
print LANG('warehouse_stock');
?>
</title>
<link rel="icon" 
      type="image/png" 
      href="favicon.png">

<link type="text/css" rel="stylesheet" href="style.css">

<script type="text/javascript">
	var dom;
	function init(){
		document.getElementById( 'stock' ).appendChild( dom );
	}
</script>
</head>
<body class="stock" id="stock">
</body>
</html>