PHPcode: Are you familiar with drupal? I want to insert a script into the user_authenticate function in user. module. what can I do? Functionuser_authenticate ($ name, $ pass) {global $ user; Trytologintheus about adding js to drupal
PHP code
// Are you familiar with drupal? I want to insert a script into the user_authenticate function in user. module. what can I do? Function user_authenticate ($ name, $ pass) {global $ user; // Try to log in the user locally. don't set $ user unless successful. if ($ account = user_load (array ('name' => $ name, 'pass' => $ pass, 'status' => 1 ))) {// Check if the e-mail is denied by an access rule. // Doing this check here saves us a user_load () in user_login_validate () // and introduces less code change for a security fix. if (drupal_is_denied ('mail', $ account-> mail) {form_set_error ('name ', t ('the name % name is registered using a reserved e-mail address and therefore cocould not be logged in. ', array (' % name' => $ account-> name); return;} else {// I want to insert a script here after successful login, could you tell me how to insert it? I tried it for one night and it was always impossible to use drupal_add_js $ user = $ account; return $ user ;}}
------ Solution --------------------
Really funny !~
PHP is the server language. JS is the client language. how can it be the same day?
Unless you set JS to Server or use echo ('