Page 1 of 1

User Profile - edit

Posted: 2022-09-10 06:32
by christian
Hello,

I am looking for a way to set individual fields to read-only for the user when editing the profile, i.e. the user can enter the fields during registration but cannot change them later. Primarily it is about the 4 "free" fields.

Where can I enter this (*.js)?

I also use the AppGini Helper. Is there a possibility here that I have not yet found, despite intensive searching.

By the way: this AppGini Helper is a cool tool.

Thank you !
Christian
profile_edit.png
profile_edit.png (25.95 KiB) Viewed 3628 times

Re: User Profile - edit

Posted: 2022-09-12 20:33
by pbottcher
Hi,

I dont think that there is a hook available for that kind of changes. So you would need to edit the membership_profile.php file in order to add your customization.

!! Remeber that this file will be overwritten once you regenerate your app.

Re: User Profile - edit

Posted: 2022-09-13 05:03
by peebee
You could perhaps try this in hooks/headers-extras.php

Code: Select all

<?php 
    $page_name = basename($_SERVER['PHP_SELF']);
    if ($page_name == 'membership_profile.php') {
?>
<script>
$j(function() {
	$j('#email').prop('readonly', true);
	$j('#custom1').prop('readonly', true);
	$j('#custom2').prop('readonly', true);
	$j('#custom3').prop('readonly', true);
	$j('#custom4').prop('readonly', true);
})
</script>
<?php
    }
?>
Should hopefully change the properties of those fields only on the membership_profile.php page and not effect on any other page.

Re: User Profile - edit

Posted: 2022-09-14 17:32
by christian
Thank you very much - both solutions work !

Christian