Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Adding email address to users in local db (patch inside)

    Scheduled Pinned Locked Moved Development
    1 Posts 1 Posters 1.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Hobby-Student
      last edited by

      Hey out there,

      my setup does need the ability to send automatically emails to users in local database. Because this is not included by default, I did a little bit of "coding"… Here are the changes:

      /usr/local/www/system_usermanager.php:

      
      if (isset($id) && $a_user[$id]) {
              $pconfig['usernamefld'] = $a_user[$id]['name'];
              $pconfig['descr'] = $a_user[$id]['descr'];
              $pconfig['expires'] = $a_user[$id]['expires'];
              $pconfig['groups'] = local_user_get_groups($a_user[$id]);
              $pconfig['utype'] = $a_user[$id]['scope'];
              $pconfig['uid'] = $a_user[$id]['uid'];
              $pconfig['authorizedkeys'] = base64_decode($a_user[$id]['authorizedkeys']);
              $pconfig['priv'] = $a_user[$id]['priv'];
              $pconfig['ipsecpsk'] = $a_user[$id]['ipsecpsk'];
      
      +      $pconfig['email'] = $a_user[$id]['email'];
      
              $pconfig['disabled'] = isset($a_user[$id]['disabled']);
      }
      
      .
      .
      .
      
      $userent['name'] = $_POST['usernamefld'];
      $userent['descr'] = $_POST['descr'];
      $userent['expires'] = $_POST['expires'];
      $userent['authorizedkeys'] = base64_encode($_POST['authorizedkeys']);
      $userent['ipsecpsk'] = $_POST['ipsecpsk'];
      
      + $userent['email'] = $_POST['email'];
      
      .
      .
      .
      
      + 
      +    
      +    
      +       />
      +       
      
      +       
      +    
      + 
      
      

      I've also attached the complete file (rename .txt to .php; Board does not allow uploading php files) . The "patch" doesn't modify current functions, just adding a new input field…
      system_usermanager.txt

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.