I am trying to add user with shell command I am getting this error
PHP Parse error: syntax error, unexpected 'require_once' (T_REQUIRE_ONCE) in /var/www/magento/shell/create_user.php on line 4
This is the file in shell folder
shell/create_user.php
<?php
// Create New admin User programmatically.
require_once('app/Mage.php');
umask(0);
Mage::app();
try {
$user = Mage::getModel('admin/user')
->setData(array(
'username' => 'username',
'firstname' => 'firstname',
'lastname' => 'lastname',
'email' => '[email protected]',
'password' => 'password!!',
'is_active' => 1
))->save();
} catch (Exception $e) {
echo $e->getMessage();
exit;
}
//Assign Role Id
try {
$user->setRoleIds(array(1)) //Administrator role id is 1 ,Here you can assign other roles ids
->setRoleUserId($user->getUserId())
->saveRelations();
} catch (Exception $e) {
echo $e->getMessage();
exit;
}
echo "User created successfully";