Your IP : 216.73.216.74


Current Path : /proc/self/root/usr/local/ei2/
Upload File :
Current File : //proc/self/root/usr/local/ei2/modx.php

#!/usr/local/php7.3/bin/php
<?php
define('MODX_API_MODE', true); // Gotta set this one constant.

require_once('index.php');

$modx= new modX();
$modx->initialize('mgr');

$query = $modx->newQuery('modUser');
$query->where(array('id'=> 1));
$user = $modx->getObjectGraph('modUser', '{ "Profile":{}, "UserGroupMembers":{} }', $query);

if (!$user)
        die("ERROR: No user with username $username");

$user->set('password', $user->_fields['password']);

if (!$user->save())
        die('ERROR: Could not save user.');