diff --git a/lam/HISTORY b/lam/HISTORY
index f6bf4b59..ffce3a82 100644
--- a/lam/HISTORY
+++ b/lam/HISTORY
@@ -1,6 +1,7 @@
March 2012 3.7
- Login: support bind user for login search
- Personal: added labeledURI and cosmetic changes, description is now multi-valued (RFE 3446363)
+ - File upload: support custom scripts postCreate (LAM Pro)
- New translation: Slovakian
- LAM Pro:
-> Password self reset can send password notification mails
diff --git a/lam/docs/manual-sources/howto.xml b/lam/docs/manual-sources/howto.xml
index 5313f88e..83b41911 100644
--- a/lam/docs/manual-sources/howto.xml
+++ b/lam/docs/manual-sources/howto.xml
@@ -3021,7 +3021,8 @@ Run slapindex to rebuild the index.
preCreate
executed before creating a new account (cancels operation
- if a script returns an exit code > 0)
+ if a script returns an exit code > 0, not available for file
+ upload)
diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc
index f7775184..e27bc797 100644
--- a/lam/lib/modules/posixAccount.inc
+++ b/lam/lib/modules/posixAccount.inc
@@ -1734,6 +1734,7 @@ class posixAccount extends baseModule implements passwordService {
// password
if (($rawAccounts[$i][$ids['posixAccount_password']] != "") && (get_preg($rawAccounts[$i][$ids['posixAccount_password']], 'password'))) {
$partialAccounts[$i]['userPassword'] = pwd_hash($rawAccounts[$i][$ids['posixAccount_password']], $pwd_enabled, $this->moduleSettings['posixAccount_pwdHash'][0]);
+ $partialAccounts[$i]['INFO.userPasswordClearText'] = $rawAccounts[$i][$ids['posixAccount_password']]; // for custom scripts etc.
}
elseif ($rawAccounts[$i][$ids['posixAccount_password']] != "") {
$errMsg = str_replace('%', '%%', $this->messages['userPassword'][4]); // double "%" because of later sprintf
diff --git a/lam/templates/massBuildAccounts.php b/lam/templates/massBuildAccounts.php
index 94a5c371..33fab11a 100644
--- a/lam/templates/massBuildAccounts.php
+++ b/lam/templates/massBuildAccounts.php
@@ -69,6 +69,9 @@ if (isset($_GET['showldif'])) {
unset($accounts[$i]['dn']);
$keys = array_keys($accounts[$i]);
for ($k = 0; $k < sizeof($keys); $k++) {
+ if (strpos($keys[$k], 'INFO.') === 0) {
+ continue;
+ }
if (is_array($accounts[$i][$keys[$k]])) {
for ($x = 0; $x < sizeof($accounts[$i][$keys[$k]]); $x++) {
echo $keys[$k] . ": " . $accounts[$i][$keys[$k]][$x] . "\n";
diff --git a/lam/templates/massDoUpload.php b/lam/templates/massDoUpload.php
index 7225d7a1..93536950 100644
--- a/lam/templates/massDoUpload.php
+++ b/lam/templates/massDoUpload.php
@@ -87,6 +87,12 @@ if (($_SESSION['mass_counter'] < sizeof($accounts)) || !isset($_SESSION['mass_po
$attrs = $accounts[$_SESSION['mass_counter']];
$dn = $attrs['dn'];
unset($attrs['dn']);
+ // remove informational attributes
+ foreach ($attrs as $key => $value) {
+ if (strpos($key, 'INFO.') === 0) {
+ unset($attrs[$key]);
+ }
+ }
$success = @ldap_add($_SESSION['ldap']->server(), $dn, $attrs);
if (!$success) {
$errorMessage = array(
@@ -135,7 +141,11 @@ if (($_SESSION['mass_counter'] < sizeof($accounts)) || !isset($_SESSION['mass_po
if ($return['status'] == 'finished') {
$_SESSION['mass_postActions']['finished'] = true;
}
- for ($i = 0; $i < sizeof($return['errors']); $i++) $_SESSION['mass_errors'][] = $return['errors'][$i];
+ if (isset($return['errors'])) {
+ for ($i = 0; $i < sizeof($return['errors']); $i++) {
+ $_SESSION['mass_errors'][] = $return['errors'][$i];
+ }
+ }
}
}
// refresh with JavaScript