Passing external parameters to the Qooxdoo application system with environment variable settings

Source: Internet
Author: User
Tags php session

When I use Qooxdoo design application system, through the need to design the login portal of the system, if the direct use of Qooxdoo to create a two drawbacks, one is the login interface is not very personalized design, and the other is the load speed issue at logon, So I usually use the Qooxdoo system when the login interface units into an HTML file, and then through the Ajax for the user name and password verification work, if the verification by using JS to point the page address to the Qooxdoo portal file. In this way, you need to pass the login user name, user ID, and other systems to Qooxdoo. I use the following methods:

Background login information is as follows:

<?phpsession_start (); include ". /options/db_settings.php "; $UserName = $_post[' UserName '); $UserPWD = $_post[' userpwd ']; $rs = $DBConn->execute (" Select User_id,login_pwd,user_name,user_role,lk_department.dept_id,dept_name,dept_kind from Lk_user_info,lk_ Department where lk_user_info.dept_id = lk_department.dept_id and Login_name= ' ". $UserName. "'"), if (! $rs->eof) {if ($rs->fields[' login_pwd ') = = Strtoupper (MD5 ($UserPWD))) {if ($rs->fields[' Dept_ Kind '] = = 1) | | ($rs->fields[' dept_kind '] = = 2)) {$arr [' status '] = 1; $arr [' Role ']= $rs->fields[' user_role ']; $arr [' msg '] = '; $_session[' logined '] =true;$_session[ ' user_id ' = $rs->fields[' user_id '];$_session[' user_name ']= $rs->fields[' user_name '];$_session[' user_role '] = $rs->fields[' user_role '];$_session[' dept_id '] = $rs->fields[' dept_id '];$_session[' dept_name ']= $rs- fields[' Dept_name ');} else {$arr [' status '] = 0; $arr [' Role ']=0; $arr [' msg '] = ' The user's unit does not have permission to log in! ';}} else {$arr [' status '] = 0; $arr [' Role ']=0; $arr [' msg '] =' Login password error, please re-enter! ';}} else {$arr [' status '] = 0; $arr [' Role ']=0; $arr [' msg '] = ' User name error, please reenter! ';} echo Json_encode ($arr);? >

And application.php is Qooxdoo's import file index.html to be modified, the specific content is as follows:

<?phpsession_start (); if (Isset ($_session[' logined ') && ($_session[' logined ') = = True)) {? ><! DOCTYPE html>
The use of this file in the PHP session to determine whether to log on, and after logging in using the $ $environment parameter to the user's user information to the Qooxdoo system. The code for the parameters in the Qooxdoo system is as follows:
This.setuserid (Qx.core.Environment.get ("UserID")); This.setusername (Qx.core.Environment.get ("UserName")); This.setdeptid (Qx.core.Environment.get ("DeptID")); This.setdeptname (Qx.core.Environment.get ("Deptname")); This.setuserrole (parseint (Qx.core.Environment.get ("userrole"));

Passing external parameters to the Qooxdoo application system with environment variable settings

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.