Cannot run a postCreate Hook by using uid field as parameters
Cannot run a postCreate Hook by using uid field as parameters
I using a post create hook ( wich work in 1.0.5-dev) for creating home directory on specific server
as argument I put %uid% which corresponding to the uid Field
Argument is used on script side And I see this message
Aug 20 15:45:04 vconsole apache2: FusionDirectory [fd-admin]: (view) error: PHP error: 'uid' was not found in attributes (/usr/share/fusiondirectory/include/class_plugin.inc, line 616)
I have another script for creating mailbox which use the mail field : it works well
(from redmine: issue id 3290, created on 2014-08-20, closed on 2014-08-25)
- Changesets:
- Revision 3ef6dbfa by Côme Chilliet on 2014-08-25T09:40:05.000Z:
Fixes #3290 Fixed hook placeholder from other tabs
- Revision 38fd63c6 by Côme Chilliet on 2014-08-25T09:40:25.000Z:
Fixes #3290 Fixed hook placeholder from other tabs
- Custom Fields:
- Bug in version: 1.0.8
- Uploads:
Link issues together to show that they're related. Learn more.
Activity
Similar problem for me. When I create a user, I run a shellscript in postcreate user (hook) with the arguments %uid% %sn% %mail% etc etc...
In the log of my script, all the arguments are empty execpt %uid% which contains the homedir of the user.
Alex
(from redmine: written on 2014-08-22)
By Alex-31 on 2017-09-02T15:12:44 (imported from GitLab)
After a test on FD 1.0.8.1 it seems that the problem is only homeDirectory.
I use a hook: user, postcreate with this "script": echo "uid: %uid% | last name: %sn% | first name: %givenName% | Home: %homeDirectory%"
I activated "display errors" and debug level for Shell in the configuration.
I created a user. Behind the debug output and the PHP errors.
DEBUG[8] (/usr/share/fusiondirectory/include/class_plugin.inc:callHook():1506) - Execute: 'echo "uid: mylogin | last name: myLastName | first name: myFirstName | Home: "' DEBUG[8] (/usr/share/fusiondirectory/include/class_plugin.inc:callHook():1520) - Result: uid: mylogin | last name: myLastName | first name: myFirstName | Home:: 'echo "uid: mylogin | last name: myLastName | first name: myFirstName | Home: "'
Oups. Seems like you've catched some kind of bug inside FusionDirectory/PHP. You may want to help us to improve the software stability. If so, please provide some more information below.
*** FusionDirectory bug report *** FusionDirectory Version: 1.0.8
Please describe what you did to produce this error as detailed as possible. Can you reproduce this bug using the demo on http://demo.FusionDirectory.org ?
*** PHP error information ***
=== Error === PHP error: 'homeDirectory' was not found in attributes (/usr/share/fusiondirectory/include/class_plugin.inc, line 616) === /Error ===
=== Trace === Trace[0]:function html_trace File : /usr/share/fusiondirectory/include/php_setup.inc Line : 226 Type : - "'homeDirectory' was not found in attributes"
Trace[1]:function gosaRaiseError File : Line : Type : - "1024","'homeDirectory' was not found in attributes","/usr/share/fusiondirectory/include/class_plugin.inc","616",array("homeDirectory",array("mylogin","myLastName","myFirstName","","","","","","","","","","","","","","","","","removed","","","","","myFirstName myLastName","","","","",array(),"","uid=fd-admin,ou=people,dc=opensides,dc=be","uid=mylogin,ou=people,dc=opensides,dc=be","default"),"",array())
Trace[2]:function trigger_error File : /usr/share/fusiondirectory/include/class_plugin.inc Line : 616 Type : - "'homeDirectory' was not found in attributes"
Trace[3]:class plugin / function tpl_parse_mask File : /usr/share/fusiondirectory/include/class_plugin.inc Line : 761 Type : static "homeDirectory",array("mylogin","myLastName","myFirstName","","","","","","","","","","","","","","","","","removed","","","","","myFirstName myLastName","","","","",array(),"","uid=fd-admin,ou=people,dc=opensides,dc=be","uid=mylogin,ou=people,dc=opensides,dc=be","default")
Trace[4]:class plugin / function tpl_parse_string File : /usr/share/fusiondirectory/include/class_plugin.inc Line : 1466 Type : static "echo "uid: %uid% | last name: %sn% | first name: %givenName% | Home: %homeDirectory%"",array("mylogin","myLastName","myFirstName","","","","","","","","","","","","","","","","","removed","","","","","myFirstName myLastName","","","","",array(),"","uid=fd-admin,ou=people,dc=opensides,dc=be","uid=mylogin,ou=people,dc=opensides,dc=be","default")
Trace[5]:class plugin / function callHook File : /usr/share/fusiondirectory/include/class_plugin.inc Line : 1404 Type : static CLASS: user,"POSTCREATE",array("mylogin")
Trace[6]:class plugin / function handle_hooks File : /usr/share/fusiondirectory/include/class_plugin.inc Line : 1432 Type : method "POST","add",array("mylogin")
Trace[7]:class plugin / function handle_post_events File : /usr/share/fusiondirectory/plugins/personal/generic/class_user.inc Line : 1057 Type : method "add",array("mylogin")
Trace[8]:class user / function save File : /usr/share/fusiondirectory/include/class_tabs.inc Line : 357 Type : method
Trace[9]:class tabs / function save File : /usr/share/fusiondirectory/plugins/admin/users/tabs_user.inc Line : 130 Type : method
Trace[10]:class usertabs / function save File : /usr/share/fusiondirectory/include/class_management.inc Line : 765 Type : method
Trace[11]:class management / function saveChanges File : /usr/share/fusiondirectory/plugins/admin/users/class_userManagement.inc Line : 406 Type : method
Trace[12]:class userManagement / function saveChanges File : /usr/share/fusiondirectory/include/class_management.inc Line : 474 Type : method "save",array(),array("save",array())
Trace[13]:class management / function handleActions File : /usr/share/fusiondirectory/include/class_management.inc Line : 181 Type : method array("save")
Trace[14]:class management / function execute File : /usr/share/fusiondirectory/plugins/admin/users/main.inc Line : 47 Type : method
Trace[15]:function require File : /usr/share/fusiondirectory/html/main.php Line : 332 Type : - "/usr/share/fusiondirectory/plugins/admin/users/main.inc" === /Trace ===
(from redmine: written on 2014-08-22)
By Jonathan Swaelens on 2017-09-02T15:12:45 (imported from GitLab)
- bmortier closed
closed
By bmortier on 2017-09-02T15:12:47 (imported from GitLab)
- bmortier added Fixed fusiondirectory-core labels
added Fixed fusiondirectory-core labels
By bmortier on 2018-10-09T19:42:35 (imported from GitLab)