password field problem

Talk about Password fields

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

Posts: 6
Joined: Feb 8th, '09, 21:25

password field problem

Postby avent » Feb 8th, '09, 21:43

I'm a newbe of DataGrid. I use version 5.02.

I tryed to use a field using the 'password' option editing the approppriate example in the template:
"password" =>array("header"=>"Password", "type"=>"password", "req_type"=>"rp", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "hide"=>"false", "generate"=>"true", "aes_cryptography"=>"true", "aes_password"=>"aes_password").
With this setting I get the following errors after editing or adding new record:
If I change 'password' setting with 'texbox' setting all work fine.
The field is this:
`password` varchar(32) NOT NULL

Can someone help me?


Site Admin
Site Admin
Posts: 5992
Joined: Jan 7th, '09, 23:18

Re: password field problem

Postby administrator » Feb 9th, '09, 10:17

1. The field must be defined in such way add/edit fields:

"user_password" =>array("header"=>"Password", "type"=>"password", "req_type"=>"rp", "width"=>"210px", "title"=>"", "readonly"=>"true", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "hide"=>"false", "generate"=>"false", "aes_cryptography"=>"true", "aes_password"=>_AES_PASSWORD),

where _AES_PASSWORD is define("_AES_PASSWORD", "my phrase for encryption bla... bla...");

2. Check also this function PreparePasswordDecryption():
Do you see there is if($field_property_type == "password"){ ?

Code: Select all

    protected function PreparePasswordDecryption(){
        // prepare decryption of password
        $fields_list = "";
        foreach($this->columns_edit_mode as $column_name => $column_array){
            $field_property_type = $this->GetFieldProperty($column_name, "type", "edit");
           if($field_property_type == "password"){
                $field_property_aes_cryptography = $this->GetFieldProperty($column_name, "aes_cryptography", "edit");
                $field_property_aes_password = $this->GetFieldProperty($column_name, "aes_password", "edit");
                if($field_property_aes_cryptography == true || $field_property_aes_cryptography = "true"){
                    $fields_list .= "AES_DECRYPT(".$column_name.", '".$column_array['aes_password']."') as ".$column_name.", ";
        return $fields_list;

Posts: 1
Joined: Mar 11th, '15, 09:36

Re: password field problem

Postby TheBirdLion » Mar 11th, '15, 10:23

I want to say that this post is very good information to read up on. I'm reading things simple. Not too labyrinthine

Return to “Field type: "password"”