Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving AD group creation to infrastructure folder
- Loading branch information
Showing
4 changed files
with
74 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
include dirname(__FILE__) . '/../../functions/config.php'; | ||
require_once(dirname(__FILE__) . '/../../functions/functions.php'); | ||
if (!check_session()){ | ||
echo json_encode(array('error' => 'nologin')); | ||
exit; | ||
} | ||
slash_vars(); | ||
$type=''; | ||
if (isset($_POST['type'])) | ||
$type=$_POST['type']; | ||
if ($type=='new'){ | ||
if (!empty($_POST['group_name'])) | ||
$group_name=$_POST['group_name']; | ||
else{ | ||
echo json_encode(array('error' => _('Empty group.'))); | ||
exit; | ||
} | ||
$existing=get_SQL_line("SELECT id FROM ad_groups WHERE name = '$group_name'"); | ||
if (!empty($existing[0])){ | ||
echo json_encode(array('error' => _('Group already exists.'))); | ||
exit; | ||
} | ||
add_SQL_line("INSERT INTO ad_groups (name) VALUES ('$group_name')"); | ||
echo json_encode(array('success' => _('New group added.'))); | ||
exit; | ||
} | ||
if ($type=='delete'){ | ||
$group=$_POST['group']; | ||
foreach ($user as $id){ | ||
add_SQL_line("DELETE FROM ad_groups WHERE id='$id' LIMIT 1"); | ||
} | ||
echo json_encode(array('success' => _('Group deleted.'))); | ||
exit; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.