UAPI::Ftp:passwd
I want to create a hook that prevent password change on certain ftp user
like example if the ftp user is admin, then stop the passwd event
how can i stop the passwd event?
can i modify the stdin user input at pre stage, to fix the password for certain username?
[PHP]if($input['data">['args">['user">=='admin')
{
die("BAILOUT You are not allow to change this ftp password!");
}
[/PHP]
[2015-06-13 16:42:18 +0800] info [uapi] ---debug_hooks---
[2015-06-13 16:42:19 +0800] info [uapi] msg: Beginning execution of script hook.
[2015-06-13 16:42:19 +0800] info [uapi] context: Cpanel::UAPI::Ftp::passwd
[2015-06-13 16:42:19 +0800] info [uapi] stage: pre
[2015-06-13 16:42:19 +0800] info [uapi] point: main
[2015-06-13 16:42:19 +0800] info [uapi] id: sXSUgwQJiV142RAk83RChHon
[2015-06-13 16:42:19 +0800] info [uapi] hook: /usr/local/cpanel/scripts/preftp
[2015-06-13 16:42:19 +0800] info [uapi] escalateprivs: 1
[2015-06-13 16:42:19 +0800] info [uapi] weight: 500
[2015-06-13 16:42:19 +0800] info [uapi] rollback: /usr/local/cpanel/scripts/postftp
[2015-06-13 16:42:19 +0800] info [uapi] data: {"user":"abc","args":{"cache_fix":"1434184798776","pass":"g#3old0FWe~I","user":"sales"},"result":null}
[2015-06-13 16:42:19 +0800] info [uapi] STDOUT output from hook: /usr/local/cpanel/scripts/preftp
[2015-06-13 16:42:19 +0800] info [uapi] BAILOUT You are not allow to change this ftp password!
[2015-06-13 16:42:19 +0800] info [uapi] End STDOUT from hook
[2015-06-13 16:42:19 +0800] warn [uapi] An exception was thrown in the hook /usr/local/cpanel/scripts/preftp for Cpanel::UAPI::Ftp::passwd at /usr/local/cpanel/Cpanel/Hooks.pm line 67
Cpanel::Hooks::hook(HASH(0x56fc3e8), HASH(0x56fc740)) called at /usr/local/cpanel/Cpanel/EventHandler.pm line 197
Cpanel::EventHandler::_uapi_std_hook(__CPANEL_HIDDEN__, __CPANEL_HIDDEN__, Cpanel::Args=HASH(0x56fc508), Cpanel::Result=HASH(0x56fbed8), __CPANEL_HIDDEN__) called at /usr/local/cpanel/Cpanel/EventHandler.pm line 165
Cpanel::EventHandler::pre_api(__CPANEL_HIDDEN__, __CPANEL_HIDDEN__, Cpanel::Args=HASH(0x56fc508), Cpanel::Result=HASH(0x56fbed8)) called at /usr/local/cpanel/Cpanel/API.pm line 102
Cpanel::API::execute(__CPANEL_HIDDEN__, __CPANEL_HIDDEN__, HASH(0x56fbef0)) called at /usr/local/cpanel/Cpanel/API.pm line 432
Cpanel::API::run_api_mode(HASH(0x56fbef0)) called at uapi.pl line 288
main::script() called at uapi.pl line 89
Please sign in to leave a comment.
Comments
1 comment