About adding js to drupal

Source: Internet
Author: User
Tags drupal
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 ('

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.