From 5949c4ed358f62aa58ba36b482aaf871015e8e0e Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 9 Dec 2025 12:14:38 +0100 Subject: [PATCH] add command to return a random string --- op/op.Ajax.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/op/op.Ajax.php b/op/op.Ajax.php index bcf3f2da7..9a3c07290 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -30,6 +30,7 @@ require_once("../inc/inc.ClassController.php"); require_once("../inc/inc.Notification.php"); use Seeddms\Seeddms\Session; +use Seeddms\Seeddms\Utilities; require_once("../inc/inc.ClassSession.php"); require_once("../inc/inc.ClassPasswordStrength.php"); @@ -100,6 +101,12 @@ switch($command) { } break; /* }}} */ + case 'randomstring': /* {{{ */ + $len = $_REQUEST["len"] ?? 16; + header('Content-Type: application/json'); + echo json_encode(array('success'=>true, 'string'=>Utilities::makeRandomString($len))); + break; /* }}} */ + case 'sessioninfo': /* {{{ */ if($user) { header('Content-Type: application/json');