LSldapObject :: _cli_remove : use LScli :: confirm

This commit is contained in:
Benjamin Renard 2020-05-08 20:38:02 +02:00
parent 1de6d1d25e
commit 3d9c11e12f

View file

@ -2041,17 +2041,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
} }
if ($confirm) { if ($confirm) {
echo $obj -> _cli_show($raw_values); $obj -> _cli_show($raw_values);
// Sure ? // Sure ?
echo "\nAre you sure you want to delete this object ? Type 'yes' to continue: "; if (!LScli :: confirm("\nAre you sure you want to delete this object?"));
$handle = fopen ("php://stdin","r");
$line = fgets($handle);
if(trim($line) != 'yes'){
echo "User cancel\n";
return True; return True;
} }
echo "\n";
}
if ($obj -> remove()) { if ($obj -> remove()) {
self :: log_info("Object ".$obj->getDn()." removed."); self :: log_info("Object ".$obj->getDn()." removed.");