mirror of
https://github.com/wheelybird/ldap-user-manager.git
synced 2025-01-18 07:32:53 +01:00
Fix deprecated variable interpolations
This commit is contained in:
parent
40ec4a151c
commit
ccc709e010
@ -65,7 +65,7 @@ if($_POST) {
|
||||
|
||||
$mail_subject = "$firstname $lastname has requested an account for $ORGANISATION_NAME.";
|
||||
|
||||
$link_url="${SITE_PROTOCOL}${SERVER_HOSTNAME}${SERVER_PATH}account_manager/new_user.php?account_request&first_name=$firstname&last_name=$lastname&email=$email";
|
||||
$link_url="{$SITE_PROTOCOL}{$SERVER_HOSTNAME}{$SERVER_PATH}account_manager/new_user.php?account_request&first_name=$firstname&last_name=$lastname&email=$email";
|
||||
|
||||
if (!isset($email)) { $email = "n/a"; }
|
||||
if (!isset($notes)) { $notes = "n/a"; }
|
||||
|
@ -35,14 +35,14 @@ $ldap_connection = open_ldap_connection();
|
||||
<?php
|
||||
|
||||
#Can we connect? The open_ldap_connection() function will call die() if we can't.
|
||||
print "$li_good Connected to ${LDAP['uri']}</li>\n";
|
||||
print "$li_good Connected to {$LDAP['uri']}</li>\n";
|
||||
|
||||
#TLS?
|
||||
if ($LDAP['connection_type'] != "plain") {
|
||||
print "$li_good Encrypted connection to ${LDAP['uri']} via ${LDAP['connection_type']}</li>\n";
|
||||
print "$li_good Encrypted connection to {$LDAP['uri']} via {$LDAP['connection_type']}</li>\n";
|
||||
}
|
||||
else {
|
||||
print "$li_warn Unable to connect to ${LDAP['uri']} via StartTLS. ";
|
||||
print "$li_warn Unable to connect to {$LDAP['uri']} via StartTLS. ";
|
||||
print "<a href='#' data-toggle='popover' title='StartTLS' data-content='";
|
||||
print "The connection to the LDAP server works, but encrypted communication can't be enabled.";
|
||||
print "'>What's this?</a></li>\n";
|
||||
@ -98,14 +98,14 @@ else {
|
||||
<ul class="list-group">
|
||||
<?php
|
||||
|
||||
$group_filter = "(&(objectclass=organizationalUnit)(ou=${LDAP['group_ou']}))";
|
||||
$ldap_group_search = ldap_search($ldap_connection, "${LDAP['base_dn']}", $group_filter);
|
||||
$group_filter = "(&(objectclass=organizationalUnit)(ou={$LDAP['group_ou']}))";
|
||||
$ldap_group_search = ldap_search($ldap_connection, "{$LDAP['base_dn']}", $group_filter);
|
||||
$group_result = ldap_get_entries($ldap_connection, $ldap_group_search);
|
||||
|
||||
if ($group_result['count'] != 1) {
|
||||
|
||||
print "$li_fail The group OU (<strong>${LDAP['group_dn']}</strong>) doesn't exist. ";
|
||||
print "<a href='#' data-toggle='popover' title='${LDAP['group_dn']}' data-content='";
|
||||
print "$li_fail The group OU (<strong>{$LDAP['group_dn']}</strong>) doesn't exist. ";
|
||||
print "<a href='#' data-toggle='popover' title='{$LDAP['group_dn']}' data-content='";
|
||||
print "This is the Organizational Unit (OU) that the groups are stored under.";
|
||||
print "'>What's this?</a>";
|
||||
print "<label class='pull-right'><input type='checkbox' name='setup_group_ou' class='pull-right' checked>Create? </label>";
|
||||
@ -114,17 +114,17 @@ if ($group_result['count'] != 1) {
|
||||
|
||||
}
|
||||
else {
|
||||
print "$li_good The group OU (<strong>${LDAP['group_dn']}</strong>) is present.</li>";
|
||||
print "$li_good The group OU (<strong>{$LDAP['group_dn']}</strong>) is present.</li>";
|
||||
}
|
||||
|
||||
$user_filter = "(&(objectclass=organizationalUnit)(ou=${LDAP['user_ou']}))";
|
||||
$ldap_user_search = ldap_search($ldap_connection, "${LDAP['base_dn']}", $user_filter);
|
||||
$user_filter = "(&(objectclass=organizationalUnit)(ou={$LDAP['user_ou']}))";
|
||||
$ldap_user_search = ldap_search($ldap_connection, "{$LDAP['base_dn']}", $user_filter);
|
||||
$user_result = ldap_get_entries($ldap_connection, $ldap_user_search);
|
||||
|
||||
if ($user_result['count'] != 1) {
|
||||
|
||||
print "$li_fail The user OU (<strong>${LDAP['user_dn']}</strong>) doesn't exist. ";
|
||||
print "<a href='#' data-toggle='popover' title='${LDAP['user_dn']}' data-content='";
|
||||
print "$li_fail The user OU (<strong>{$LDAP['user_dn']}</strong>) doesn't exist. ";
|
||||
print "<a href='#' data-toggle='popover' title='{$LDAP['user_dn']}' data-content='";
|
||||
print "This is the Organisational Unit (OU) that the user accounts are stored under.";
|
||||
print "'>What's this?</a>";
|
||||
print "<label class='pull-right'><input type='checkbox' name='setup_user_ou' class='pull-right' checked>Create? </label>";
|
||||
@ -133,7 +133,7 @@ if ($user_result['count'] != 1) {
|
||||
|
||||
}
|
||||
else {
|
||||
print "$li_good The user OU (<strong>${LDAP['user_dn']}</strong>) is present.</li>";
|
||||
print "$li_good The user OU (<strong>{$LDAP['user_dn']}</strong>) is present.</li>";
|
||||
}
|
||||
|
||||
?>
|
||||
@ -148,13 +148,13 @@ else {
|
||||
<?php
|
||||
|
||||
$gid_filter = "(&(objectclass=device)(cn=lastGID))";
|
||||
$ldap_gid_search = ldap_search($ldap_connection, "${LDAP['base_dn']}", $gid_filter);
|
||||
$ldap_gid_search = ldap_search($ldap_connection, "{$LDAP['base_dn']}", $gid_filter);
|
||||
$gid_result = ldap_get_entries($ldap_connection, $ldap_gid_search);
|
||||
|
||||
if ($gid_result['count'] != 1) {
|
||||
|
||||
print "$li_warn The <strong>lastGID</strong> entry doesn't exist. ";
|
||||
print "<a href='#' data-toggle='popover' title='cn=lastGID,${LDAP['base_dn']}' data-content='";
|
||||
print "<a href='#' data-toggle='popover' title='cn=lastGID,{$LDAP['base_dn']}' data-content='";
|
||||
print "This is used to store the last group ID used when creating a POSIX group. Without this the highest current group ID is found and incremented, but this might re-use the GID from a deleted group.";
|
||||
print "'>What's this?</a>";
|
||||
print "<label class='pull-right'><input type='checkbox' name='setup_last_gid' class='pull-right' checked>Create? </label>";
|
||||
@ -168,13 +168,13 @@ else {
|
||||
|
||||
|
||||
$uid_filter = "(&(objectclass=device)(cn=lastUID))";
|
||||
$ldap_uid_search = ldap_search($ldap_connection, "${LDAP['base_dn']}", $uid_filter);
|
||||
$ldap_uid_search = ldap_search($ldap_connection, "{$LDAP['base_dn']}", $uid_filter);
|
||||
$uid_result = ldap_get_entries($ldap_connection, $ldap_uid_search);
|
||||
|
||||
if ($uid_result['count'] != 1) {
|
||||
|
||||
print "$li_warn The <strong>lastUID</strong> entry doesn't exist. ";
|
||||
print "<a href='#' data-toggle='popover' title='cn=lastUID,${LDAP['base_dn']}' data-content='";
|
||||
print "<a href='#' data-toggle='popover' title='cn=lastUID,{$LDAP['base_dn']}' data-content='";
|
||||
print "This is used to store the last user ID used when creating a POSIX account. Without this the highest current user ID is found and incremented, but this might re-use the UID from a deleted account.";
|
||||
print "'>What's this?</a>";
|
||||
print "<label class='pull-right'><input type='checkbox' name='setup_last_uid' class='pull-right' checked>Create? </label>";
|
||||
@ -187,8 +187,8 @@ else {
|
||||
}
|
||||
|
||||
|
||||
$defgroup_filter = "(&(objectclass=posixGroup)(${LDAP['group_attribute']}=${DEFAULT_USER_GROUP}))";
|
||||
$ldap_defgroup_search = ldap_search($ldap_connection, "${LDAP['base_dn']}", $defgroup_filter);
|
||||
$defgroup_filter = "(&(objectclass=posixGroup)({$LDAP['group_attribute']}={$DEFAULT_USER_GROUP}))";
|
||||
$ldap_defgroup_search = ldap_search($ldap_connection, "{$LDAP['base_dn']}", $defgroup_filter);
|
||||
$defgroup_result = ldap_get_entries($ldap_connection, $ldap_defgroup_search);
|
||||
|
||||
if ($defgroup_result['count'] != 1) {
|
||||
@ -207,15 +207,15 @@ else {
|
||||
}
|
||||
|
||||
|
||||
$adminsgroup_filter = "(&(objectclass=posixGroup)(${LDAP['group_attribute']}=${LDAP['admins_group']}))";
|
||||
$ldap_adminsgroup_search = ldap_search($ldap_connection, "${LDAP['base_dn']}", $adminsgroup_filter);
|
||||
$adminsgroup_filter = "(&(objectclass=posixGroup)({$LDAP['group_attribute']}={$LDAP['admins_group']}))";
|
||||
$ldap_adminsgroup_search = ldap_search($ldap_connection, "{$LDAP['base_dn']}", $adminsgroup_filter);
|
||||
$adminsgroup_result = ldap_get_entries($ldap_connection, $ldap_adminsgroup_search);
|
||||
|
||||
if ($adminsgroup_result['count'] != 1) {
|
||||
|
||||
print "$li_fail The group defining LDAP account administrators (<strong>${LDAP['admins_group']}</strong>) doesn't exist. ";
|
||||
print "$li_fail The group defining LDAP account administrators (<strong>{$LDAP['admins_group']}</strong>) doesn't exist. ";
|
||||
print "<a href='#' data-toggle='popover' title='LDAP account administrators group' data-content='";
|
||||
print "Only members of this group (${LDAP['admins_group']}) will be able to access the account managment section, so it's definitely something you'll want to create.";
|
||||
print "Only members of this group ({$LDAP['admins_group']}) will be able to access the account managment section, so it's definitely something you'll want to create.";
|
||||
print "'>What's this?</a>";
|
||||
print "<label class='pull-right'><input type='checkbox' name='setup_admins_group' class='pull-right' checked>Create? </label>";
|
||||
print "</li>\n";
|
||||
@ -223,7 +223,7 @@ if ($adminsgroup_result['count'] != 1) {
|
||||
|
||||
}
|
||||
else {
|
||||
print "$li_good The LDAP account administrators group (<strong>${LDAP['admins_group']}</strong>) is present.</li>";
|
||||
print "$li_good The LDAP account administrators group (<strong>{$LDAP['admins_group']}</strong>) is present.</li>";
|
||||
|
||||
$admins = ldap_get_group_members($ldap_connection,$LDAP['admins_group']);
|
||||
|
||||
@ -249,7 +249,7 @@ if ($show_finish_button == TRUE) {
|
||||
?>
|
||||
</form>
|
||||
<div class='well'>
|
||||
<form action="<?php print "${SERVER_PATH}log_in"; ?>">
|
||||
<form action="<?php print "{$SERVER_PATH}log_in"; ?>">
|
||||
<input type='submit' class="btn btn-success center-block" value='Done'>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -37,11 +37,11 @@ if (isset($_POST['fix_problems'])) {
|
||||
if (isset($_POST['setup_group_ou'])) {
|
||||
$ou_add = @ ldap_add($ldap_connection, $LDAP['group_dn'], array( 'objectClass' => 'organizationalUnit', 'ou' => $LDAP['group_ou'] ));
|
||||
if ($ou_add == TRUE) {
|
||||
print "$li_good Created OU <strong>${LDAP['group_dn']}</strong></li>\n";
|
||||
print "$li_good Created OU <strong>{$LDAP['group_dn']}</strong></li>\n";
|
||||
}
|
||||
else {
|
||||
$error = ldap_error($ldap_connection);
|
||||
print "$li_fail Couldn't create ${LDAP['group_dn']}: <pre>$error</pre></li>\n";
|
||||
print "$li_fail Couldn't create {$LDAP['group_dn']}: <pre>$error</pre></li>\n";
|
||||
$no_errors = FALSE;
|
||||
}
|
||||
}
|
||||
@ -50,11 +50,11 @@ if (isset($_POST['fix_problems'])) {
|
||||
if (isset($_POST['setup_user_ou'])) {
|
||||
$ou_add = @ ldap_add($ldap_connection, $LDAP['user_dn'], array( 'objectClass' => 'organizationalUnit', 'ou' => $LDAP['user_ou'] ));
|
||||
if ($ou_add == TRUE) {
|
||||
print "$li_good Created OU <strong>${LDAP['user_dn']}</strong></li>\n";
|
||||
print "$li_good Created OU <strong>{$LDAP['user_dn']}</strong></li>\n";
|
||||
}
|
||||
else {
|
||||
$error = ldap_error($ldap_connection);
|
||||
print "$li_fail Couldn't create ${LDAP['user_dn']}: <pre>$error</pre></li>\n";
|
||||
print "$li_fail Couldn't create {$LDAP['user_dn']}: <pre>$error</pre></li>\n";
|
||||
$no_errors = FALSE;
|
||||
}
|
||||
}
|
||||
@ -69,14 +69,14 @@ if (isset($_POST['fix_problems'])) {
|
||||
'serialnumber' => $highest_gid,
|
||||
'description' => $description );
|
||||
|
||||
$gid_add = @ ldap_add($ldap_connection, "cn=lastGID,${LDAP['base_dn']}", $add_lastgid_r);
|
||||
$gid_add = @ ldap_add($ldap_connection, "cn=lastGID,{$LDAP['base_dn']}", $add_lastgid_r);
|
||||
|
||||
if ($gid_add == TRUE) {
|
||||
print "$li_good Created <strong>cn=lastGID,${LDAP['base_dn']}</strong></li>\n";
|
||||
print "$li_good Created <strong>cn=lastGID,{$LDAP['base_dn']}</strong></li>\n";
|
||||
}
|
||||
else {
|
||||
$error = ldap_error($ldap_connection);
|
||||
print "$li_fail Couldn't create cn=lastGID,${LDAP['base_dn']}: <pre>$error</pre></li>\n";
|
||||
print "$li_fail Couldn't create cn=lastGID,{$LDAP['base_dn']}: <pre>$error</pre></li>\n";
|
||||
$no_errors = FALSE;
|
||||
}
|
||||
}
|
||||
@ -91,14 +91,14 @@ if (isset($_POST['fix_problems'])) {
|
||||
'serialnumber' => $highest_uid,
|
||||
'description' => $description );
|
||||
|
||||
$uid_add = @ ldap_add($ldap_connection, "cn=lastUID,${LDAP['base_dn']}", $add_lastuid_r);
|
||||
$uid_add = @ ldap_add($ldap_connection, "cn=lastUID,{$LDAP['base_dn']}", $add_lastuid_r);
|
||||
|
||||
if ($uid_add == TRUE) {
|
||||
print "$li_good Created <strong>cn=lastUID,${LDAP['base_dn']}</strong></li>\n";
|
||||
print "$li_good Created <strong>cn=lastUID,{$LDAP['base_dn']}</strong></li>\n";
|
||||
}
|
||||
else {
|
||||
$error = ldap_error($ldap_connection);
|
||||
print "$li_fail Couldn't create cn=lastUID,${LDAP['base_dn']}: <pre>$error</pre></li>\n";
|
||||
print "$li_fail Couldn't create cn=lastUID,{$LDAP['base_dn']}: <pre>$error</pre></li>\n";
|
||||
$no_errors = FALSE;
|
||||
}
|
||||
}
|
||||
@ -123,7 +123,7 @@ if (isset($_POST['fix_problems'])) {
|
||||
$group_add = ldap_new_group($ldap_connection,$LDAP['admins_group']);
|
||||
|
||||
if ($group_add == TRUE) {
|
||||
print "$li_good Created LDAP administrators group: <strong>${LDAP['admins_group']}</strong></li>\n";
|
||||
print "$li_good Created LDAP administrators group: <strong>{$LDAP['admins_group']}</strong></li>\n";
|
||||
}
|
||||
else {
|
||||
$error = ldap_error($ldap_connection);
|
||||
@ -138,19 +138,19 @@ if (isset($_POST['fix_problems'])) {
|
||||
|
||||
?>
|
||||
<div class="form-group">
|
||||
<form action="<?php print "${SERVER_PATH}account_manager/new_user.php"; ?>" method="post">
|
||||
<form action="<?php print "{$SERVER_PATH}account_manager/new_user.php"; ?>" method="post">
|
||||
<input type="hidden" name="setup_admin_account">
|
||||
<?php
|
||||
print "$li_fail The LDAP administration group is empty. ";
|
||||
print "<a href='#' data-toggle='popover' title='LDAP account administrators' data-content='";
|
||||
print "Only members of this group (${LDAP['admins_group']}) will be able to access the account managment section, so we need to add people to it.";
|
||||
print "Only members of this group ({$LDAP['admins_group']}) will be able to access the account managment section, so we need to add people to it.";
|
||||
print "'>What's this?</a>";
|
||||
print "<label class='pull-right'><input type='checkbox' name='setup_admin_account' class='pull-right' checked>Create a new account and add it to the admin group? </label>";
|
||||
print "</li>\n";
|
||||
$show_create_admin_button = TRUE;
|
||||
}
|
||||
else {
|
||||
print "$li_good The LDAP account administrators group (<strong>${LDAP['admins_group']}</strong>) isn't empty.</li>";
|
||||
print "$li_good The LDAP account administrators group (<strong>{$LDAP['admins_group']}</strong>) isn't empty.</li>";
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user