User Profile - edit

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
christian
Posts: 15
Joined: 2022-07-31 08:33

User Profile - edit

Post by christian » 2022-09-10 06:32

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 1614 times

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: User Profile - edit

Post by pbottcher » 2022-09-12 20:33

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.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: User Profile - edit

Post by peebee » 2022-09-13 05:03

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.

christian
Posts: 15
Joined: 2022-07-31 08:33

Re: User Profile - edit

Post by christian » 2022-09-14 17:32

Thank you very much - both solutions work !

Christian

Post Reply