Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
technical:api-pu-expiry [2026/02/12 12:28] – created systemtechnical:api-pu-expiry [2026/02/12 12:46] (current) system
Line 12: Line 12:
 </alert> </alert>
  
-  To terminate user'active sessions we will work on filtered list of active sessions for user.+<alert type="warning"> 
 +  RADIUSdesk includes component called 'ISP-Plumbing' which needs to be configured first. 
 +  * When this component is configured, any active sessions for a user will be terminated if the user's admin state was set to expired (to_date in the past) and set to time in the future. 
 +  * This comes in handy if the user was in a suspended IP Pool with the expired state and then a payment was made thus making his account active again. 
 +</alert> 
 + 
 +  * To change the expiry date (to_date) of Permanent User we first have to determine the id of the Permanent User. 
 +  * A CRM system typically do not know the id of the Permanent User in RADIUSdesk.
   * With the sample script we use two APIs   * With the sample script we use two APIs
-      * The one API is used get a list of active sessions for a specified Permanent User, if there are any+      * The one API is used get a list of Permanent Users to collect their ids
-      * The other API is used to terminate each of the sessions which was obtained with the first API call. +      * The other API is used to set the new expiry date (to_date) of the collected users 
-<file php permanent_user_terminate_session.php>+<file php permanent_user_set_expiry.php>
 <?php <?php
  
Line 25: Line 32:
  
 $username   = 'testuser@dev'; $username   = 'testuser@dev';
-$api_url    = "$server/cake4/rd_cake/radaccts/kick-active.json";+$api_url    = "$server/cake4/rd_cake/top-ups/add.json";
  
 // Filter settings // Filter settings
Line 84: Line 91:
 } }
  
-function sendDisconnectRequest($url, $data) {+function changeExpiryDate($url, $data) {
  
     // Build the query string from $data     // Build the query string from $data
  • technical/api-pu-expiry.1770892108.txt.gz
  • Last modified: 2026/02/12 12:28
  • by system