This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
switch ($modx->event->name) { | |
case 'OnHandleRequest': | |
if ($modx->context->key == 'mgr') {return;} | |
if (!isset($_SESSION['lang']) && isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { | |
if (preg_match('/ru/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'])) { | |
$_SESSION['lang'] = 'ru'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
untitled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Очистка цепочек правил | |
iptables -F INPUT | |
iptables -Z INPUT | |
iptables -P INPUT ACCEPT | |
iptables -F OUTPUT | |
iptables -Z OUTPUT | |
iptables -P OUTPUT ACCEPT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER=mysqlroot | |
PASSWORD=mysqlrootpass | |
BACKUP=/home/bezumkin/Backup | |
OLD=7 # Сколько дней хранить бэкапы | |
# Создаем директорию для сегодняшнего бэкапа | |
DIR=$BACKUP/`date '+%Y-%m-%d'` | |
mkdir $DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER=root | |
PASSWORD=111111 | |
BACKUP=/home/backup | |
OLD=7 # Сколько дней хранить бэкапы | |
# Создаем директорию для сегодняшнего бэкапа | |
DIR=$BACKUP/`date '+%Y-%m-%d'` | |
mkdir $DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Set permissions for /mag2.promoway1.ru/www..."; | |
echo "CHOWN files..."; | |
chown -R u19587:u19587 "/mag2.promoway1.ru/www"; | |
echo "CHMOD directories..."; | |
find "/mag2.promoway1.ru/www" -type d -exec chmod 0755 '{}' \; | |
echo "CHMOD files..."; | |
find "/mag2.promoway1.ru/www" -type f -exec chmod 0644 '{}' \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get nodes for the resource tree | |
* | |
* @package modx | |
* @subpackage processors.layout.tree.resource | |
*/ | |
class modResourceGetNodesProcessor extends modProcessor { | |
/** @var int $defaultRootId */ | |
public $defaultRootId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>первый вызов</h2> | |
[[!AjaxSnippet? | |
&snippet=`pdoPage` | |
&element=`msProducts` | |
&tpl=`tpl.msProducts.row` | |
&limit=`3` | |
&depth=`1` | |
&parents=`4` | |
&showLog=`0` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hash = { | |
// Получаем данные из адреса | |
get: function() { | |
var vars = {}, hash, splitter, hashes; | |
if (!this.oldbrowser()) { | |
var pos = window.location.href.indexOf('?'); | |
hashes = (pos != -1) ? decodeURIComponent(window.location.href.substr(pos + 1)) : ''; | |
splitter = '&'; | |
} | |
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!$modx->user->isAuthenticated('mgr')) return; | |
$placeholders = $prefix ? array() : $modx->placeholders; | |
if ($prefix) { | |
foreach ($modx->placeholders as $key => $ph) { | |
if (strpos($key, $prefix) === 0) { | |
$placeholders[$key] = $ph; | |
} |