function changepassword_maint_alm_users_BeforeUpdate(&$sender) { $changepassword_maint_alm_users_BeforeUpdate = true; $Component =& $sender; $Container =& CCGetParentContainer($sender); global $changepassword_maint; //Compatibility //End changepassword_maint_alm_users_BeforeUpdate //Custom Code @9-2A29BDB7 // ------------------------- // Write your own code here. if (trim($changepassword_maint->alm_users->password->Value) != "" && trim($changepassword_maint->alm_users->password1->Value) != "") { if (trim($changepassword_maint->alm_users->password->Value) != trim($changepassword_maint->alm_users->password1->Value)) { $changepassword_maint->alm_users->UpdateAllowed = false; $changepassword_maint->alm_users->Errors->addError("PASSWORDS MUST BE THE SAME TO APPLY THE CHANGE."); } else { $changepassword_maint->alm_users->UpdateAllowed = true; $changepassword_maint->alm_users->password_Shadow->SetValue(CCEncryptPasswordDB(trim($changepassword_maint->alm_users->password->Value))); $changepassword_maint->alm_users->password->SetValue($changepassword_maint->alm_users->password_Shadow->Value); } } else { $changepassword_maint->alm_users->UpdateAllowed = false; $changepassword_maint->alm_users->Errors->addError("PASSWORD CANNOT BE BLANK."); } // ------------------------- //End Custom Code //Close changepassword_maint_alm_users_BeforeUpdate @2-EF064701 return $changepassword_maint_alm_users_BeforeUpdate; }
function users_maintcontent_alm_users_ds_BeforeBuildUpdate(&$sender) { $users_maintcontent_alm_users_ds_BeforeBuildUpdate = true; $Component =& $sender; $Container =& CCGetParentContainer($sender); global $users_maintcontent; //Compatibility //End users_maintcontent_alm_users_ds_BeforeBuildUpdate //Encrypt Password @8-A0C855A5 if ("" != $Component->DataSource->password->GetValue()) { $Component->DataSource->password->SetValue(CCEncryptPasswordDB($Component->DataSource->password->GetValue())); } else { $Component->DataSource->password->SetValue(CCDecryptString($Component->DataSource->password_Shadow->GetValue(), CCS_ENCRYPTION_KEY_FOR_COOKIE)); } //End Encrypt Password //Close users_maintcontent_alm_users_ds_BeforeBuildUpdate @3-CF5EA73C return $users_maintcontent_alm_users_ds_BeforeBuildUpdate; }