Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Automated email request and removal

Discussion in 'cPanel Developers' started by Sebastian Ng, May 2, 2017.

  1. Sebastian Ng

    Sebastian Ng Member

    Joined:
    May 2, 2017
    Messages:
    16
    Likes Received:
    4
    Trophy Points:
    3
    Location:
    Penang, Malaysia
    cPanel Access Level:
    Root Administrator
    Hello members and staffs,

    Do anyone here created an automated email request simply app for internal use,
    like create a website, login authenticate using email and password, request for new account for your staff, fill in forms like name, new email account name, secondary personal email for password notification, cell phone number for sms to get notify, approval your superior. then submit.
    The form will notify your superior approval via sms and email, once approve will notify you and your new staff via sms and email.

    and if a staff resign, during exit interview or resign approval, their email auto forward to their superior, auto respond to senders say this person no longer with the company please send to their superior, and remove their email account.

    i believe this can be done using cpanel uapi, php, mysql with some logics plus company policies.

    I need help to do this, i am stuck with the uapi authentication side.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,659
    Likes Received:
    1,428
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm not aware of any third-party applications that offer that specific functionality, but I'm happy to help answer any questions you have about cPanel UAPI functions. Could you let us know what in-particular you are stuck with?

    You can also find a list of system administration services on the following URL if you would like to hire someone to help develop a custom application for you:

    System Administration Services | cPanel Forums

    Thank you.
     
  3. Sebastian Ng

    Sebastian Ng Member

    Joined:
    May 2, 2017
    Messages:
    16
    Likes Received:
    4
    Trophy Points:
    3
    Location:
    Penang, Malaysia
    cPanel Access Level:
    Root Administrator
    Thank you Michael for the fast responds,

    I will try to do the application myself.
    Thank you very much
     
    cPanelMichael likes this.
  4. Sebastian Ng

    Sebastian Ng Member

    Joined:
    May 2, 2017
    Messages:
    16
    Likes Received:
    4
    Trophy Points:
    3
    Location:
    Penang, Malaysia
    cPanel Access Level:
    Root Administrator
    Dear Michael,

    Is there any working sample coding on uapi on php?

    Sebastian
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,659
    Likes Received:
    1,428
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  6. Sebastian Ng

    Sebastian Ng Member

    Joined:
    May 2, 2017
    Messages:
    16
    Likes Received:
    4
    Trophy Points:
    3
    Location:
    Penang, Malaysia
    cPanel Access Level:
    Root Administrator
    Good morning,

    I notice that xml-api that i use for uapi that is apiversion=3 have depreciated.
    I plan to use verify_password for webmail as i making login page that uses webmail username and webmail password have depreciated, is there any other alternative?
    My plan is to allow webmail user request new email account for their subordinate, send an email notification to their direct superior to approve the request. Once approve a new email account will be created and a new notification will reply the requestor and also sms to the subordinate on the login page link, username and password.

    If a person resign or absconded, HR will login to the login and trigger email account removal, autoresponder and forward future email to their superior.

    Now my problem i do not know how to use verify_password in UAPI. Please advice.

    Regards,
    Sebastian
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,659
    Likes Received:
    1,428
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello Sebastian,

    You can find more information about the deprecation of the XML-API output of cPanel APIs at:

    March Development Update | cPanel Blog

    Here's the relevant section:

    You can find documentation on this UAPI function at:

    UAPI Functions - Email::verify_password - Software Development Kit - cPanel Documentation

    This includes an example of the JSON output.

    Thank you.
     
  8. Sebastian Ng

    Sebastian Ng Member

    Joined:
    May 2, 2017
    Messages:
    16
    Likes Received:
    4
    Trophy Points:
    3
    Location:
    Penang, Malaysia
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    Thank you for the info.

    I will try out the JSON method.

    Sebastian Ng
     
    cPanelMichael likes this.
  9. Sebastian Ng

    Sebastian Ng Member

    Joined:
    May 2, 2017
    Messages:
    16
    Likes Received:
    4
    Trophy Points:
    3
    Location:
    Penang, Malaysia
    cPanel Access Level:
    Root Administrator
    I have found this tutorial
    Tutorial - Create a New Paper Lantern Interface in PHP - Software Development Kit - cPanel Documentation
    I hope can learn some thing from it.

    <?php
    include("/usr/local/cpanel/php/cpanel.php"); // Instantiate the CPANEL object.
    $cpanel = new CPANEL(); // Connect to cPanel - only do this once.
    print $cpanel->header( "Page Heading" ); // Add the header.
    ?>

    <?php
    $get_userdata = $cpanel->uapi( // Get domain user data.
    'DomainInfo', 'domains_data',
    array(
    'format' => 'hash',
    )
    );
    ?>

    <?php
    print $cpanel->footer(); // Add the footer.
    $cpanel->end(); // Disconnect from cPanel - only do this once.
    ?>
     
Loading...

Share This Page