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 | |
/** | |
* checkUsername | |
* FormIt custom validator. Check if no other user has the same username | |
* | |
* Usage: | |
* &validate=`yourfield:checkUsername` | |
* To set an custom error text; use like default ones; | |
* &vTextCheckUsername=`Your custom error text!` | |
* |
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 | |
/** | |
* UserIsLoggedin | |
* Checks whether or not a user is logged in or not and does something with it | |
* | |
* Examples (top-down): | |
* [[!UserIsLoggedin? &redirectToOnNotAuthorized=`id-of-page`]] | |
* OR | |
* [[!UserIsLoggedin? &sendUnauthorized=`1`]] | |
* OR |
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 | |
// UniqueAlias | |
$eventName = $modx->event->name; | |
switch($eventName) { | |
case 'OnResourceDuplicate': | |
if($newResource->get('alias')) { | |
$alias = $newResource->get('alias'); | |
} | |
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 | |
/* | |
* WP Import, Ver 2015.01.04 | |
* (C) 2015 by ZoRg Soft | |
* MODx Notes - WP Import модуь для импорта записей из Wordpress | |
* http://agarkov.org/modx-x/evo-wpimport | |
*/ | |
$theme = $modx->config['manager_theme']; | |
$basePath = $modx->config['base_path']; |
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 | |
/* | |
simplx.dompdf | |
*/ | |
$filename = isset($filename) ? $filename : false; | |
$outputto = isset($outputto) ? $outputto : 'file'; |
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 | |
/* | |
snippet2placeholder | |
by Bruno17 | |
http://www.modxcms.de/forum/comments.php?DiscussionID=5524#Item_4 | |
Create placeholder from a snippet, for example wayfinder | |
[[snippet2placeholder? | |
&snippet=`Wayfinder` | |
&startId=`1` |
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 | |
# MySQL root password | |
ROOTPASS='password' | |
TIMEZONE='Europe/Moscow' | |
MYSQLPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12` | |
SFTPPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12` | |
PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12` | |
############## |
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 | |
# MySQL root password | |
ROOTPASS='password' | |
TIMEZONE='Europe/Moscow' | |
MYSQLPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12` | |
SFTPPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12` | |
PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12` | |
############## |
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 | |
echo "Enter username" | |
read USERNAME | |
############## | |
echo "Updating MODx" | |
cd /var/www/$USERNAME/www/ |
OlderNewer