Last active
August 3, 2016 15:09
Revisions
-
gvozdb revised this gist
Feb 15, 2016 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,6 @@ 'primary_group' => 1, )); $u->setSudo(1); $p = $modx->newObject('modUserProfile'); $p->fromArray(array( 'fullname' => $user, -
gvozdb revised this gist
Feb 15, 2016 . 1 changed file with 18 additions and 21 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -13,29 +13,26 @@ if (file_exists($index_php)) { require_once $index_php; } else { print "Не удалось найти MODX"; die; } $user = empty($_GET['user']) ? 'user'. rand(99,9999) : $_GET['user']; $pass = empty($_GET['pass']) ? rand(10000000,99999999) : $_GET['pass']; $u = $modx->newObject('modUser'); $u->fromArray(array( 'username' => $user, 'password' => $pass, 'active' => 1, 'primary_group' => 1, )); $u->setSudo(1); $u->save(); $p = $modx->newObject('modUserProfile'); $p->fromArray(array( 'fullname' => $user, 'email' => $user.'@mail.ru', )); $u->addOne($p); $u->save(); if (!empty($u->username)) { print '<p><b>user:</b> '. $user .'</p><p><b>pass:</b> '. $pass .'</p>'; } -
gvozdb revised this gist
Feb 15, 2016 . No changes.There are no files selected for viewing
-
gvozdb created this gist
Feb 15, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ <?php // Подключаем define('MODX_API_MODE', true); $i=0; $current_dir = dirname(__FILE__) .'/'; $index_php = $current_dir .'index.php'; while (!file_exists($index_php) && $i < 9) { $current_dir = dirname(dirname($index_php)) .'/'; $index_php = $current_dir .'index.php'; $i++; } if (file_exists($index_php)) { require_once $index_php; } else { print "Не удалось найти MODX"; die; } // Включаем обработку ошибок $modx->getService('error','error.modError'); $modx->setLogLevel(modX::LOG_LEVEL_ERROR); $modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML'); $user = empty($_GET['user']) ? 'user'. rand(99,9999) : $_GET['user']; $pass = empty($_GET['pass']) ? rand(10000000,99999999) : $_GET['pass']; $uObj = $modx->newObject('modUser'); $uObj->set('username', $user); $uObj->set('password', $pass); $uObj->set('active', 1); $uObj->set('primary_group', 1); $uObj->setSudo(1); $uObj->save(); $pObj = $modx->newObject('modUserProfile'); $pObj->set('fullname', 'Фамилия Имя'); $pObj->set('email', $user .'@mail.ru'); $uObj->addOne($pObj); $pObj->save(); $uObj->save(); if (!empty($uObj->username)) { print '<b>user:</b> '. $user .'<br/><b>pass:</b> '. $pass; }