Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit f5075e3

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents 35dabb9 + 9690828 commit f5075e3

File tree

3 files changed

+79
-47
lines changed

3 files changed

+79
-47
lines changed

core/src/plugins/action.scheduler/class.AjxpScheduler.php

100644100755
Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ public function runTask($taskId, $status = null, &$currentlyRunning = -1, $force
189189
$data["user_id"] = "queue:".$tmpQueue;
190190
}
191191
if ($data["repository_id"] == "*") {
192-
$data["repository_id"] = implode(",", array_keys(ConfService::getRepositoriesList("all")));
192+
$criteria = array();
193+
$criteria["isTemplate"] = false;
194+
$count = 0;
195+
$listRepos = ConfService::listRepositoriesWithCriteria($criteria, $count);
196+
$data["repository_id"] = implode(",", array_keys($listRepos));
193197
}
194198
$process = AJXP_Controller::applyActionInBackground(
195199
$data["repository_id"],
@@ -270,7 +274,7 @@ public function switchAction($action, $httpVars, $postProcessData)
270274
AJXP_XMLWriter::close();
271275
}
272276

273-
break;
277+
break;
274278

275279
case "scheduler_runTask":
276280

@@ -280,7 +284,7 @@ public function switchAction($action, $httpVars, $postProcessData)
280284
AJXP_XMLWriter::reloadDataNode();
281285
AJXP_XMLWriter::close();
282286

283-
break;
287+
break;
284288

285289
case "scheduler_generateCronExpression":
286290

@@ -291,10 +295,10 @@ public function switchAction($action, $httpVars, $postProcessData)
291295
HTMLWriter::charsetHeader("text/plain", "UTF-8");
292296
print "$cronTiming $phpCmd $rootInstall -r=ajxp_conf -u=".AuthService::getLoggedUser()->getId()." -p=YOUR_PASSWORD_HERE -a=scheduler_runAll >> $logFile";
293297

294-
break;
298+
break;
295299

296300
default:
297-
break;
301+
break;
298302
}
299303

300304
}
@@ -331,26 +335,26 @@ public function listTasks($action, $httpVars, $postProcessData)
331335

332336
$timeArray = $this->getTimeArray($task["schedule"]);
333337
$res = $this->getNextExecutionTimeForScript(time(), $timeArray);
334-
$task["NEXT_EXECUTION"] = date($mess["date_format"], $res);
335-
$task["PARAMS"] = implode(", ", $task["PARAMS"]);
336-
$task["icon"] = "scheduler/ICON_SIZE/task.png";
337-
$task["ajxp_mime"] = "scheduler_task";
338-
$sFile = AJXP_CACHE_DIR."/cmd_outputs/task_".$task["task_id"].".status";
339-
if (is_file($sFile)) {
340-
$s = $this->getTaskStatus($task["task_id"]);
341-
$task["STATUS"] = implode(":", $s);
342-
$task["LAST_EXECUTION"] = date($mess["date_format"], filemtime($sFile));
343-
} else {
344-
$task["STATUS"] = "n/a";
345-
$task["LAST_EXECUTION"] = "n/a";
346-
}
347-
348-
AJXP_XMLWriter::renderNode("/admin/scheduler/".$task["task_id"],
349-
(isSet($task["label"])?$task["label"]:"Action ".$task["action_name"]),
350-
true,
351-
$task
352-
);
338+
$task["NEXT_EXECUTION"] = date($mess["date_format"], $res);
339+
$task["PARAMS"] = implode(", ", $task["PARAMS"]);
340+
$task["icon"] = "scheduler/ICON_SIZE/task.png";
341+
$task["ajxp_mime"] = "scheduler_task";
342+
$sFile = AJXP_CACHE_DIR."/cmd_outputs/task_".$task["task_id"].".status";
343+
if (is_file($sFile)) {
344+
$s = $this->getTaskStatus($task["task_id"]);
345+
$task["STATUS"] = implode(":", $s);
346+
$task["LAST_EXECUTION"] = date($mess["date_format"], filemtime($sFile));
347+
} else {
348+
$task["STATUS"] = "n/a";
349+
$task["LAST_EXECUTION"] = "n/a";
353350
}
351+
352+
AJXP_XMLWriter::renderNode("/admin/scheduler/".$task["task_id"],
353+
(isSet($task["label"])?$task["label"]:"Action ".$task["action_name"]),
354+
true,
355+
$task
356+
);
357+
}
354358
AJXP_XMLWriter::close();
355359

356360
}
@@ -457,7 +461,7 @@ public function handleTasks($action, $httpVars, $fileVars)
457461
AJXP_XMLWriter::reloadDataNode();
458462
AJXP_XMLWriter::close();
459463

460-
break;
464+
break;
461465

462466
case "scheduler_removeTask" :
463467

@@ -467,7 +471,7 @@ public function handleTasks($action, $httpVars, $fileVars)
467471
AJXP_XMLWriter::reloadDataNode();
468472
AJXP_XMLWriter::close();
469473

470-
break;
474+
break;
471475

472476
case "scheduler_loadTask":
473477

@@ -502,10 +506,10 @@ public function handleTasks($action, $httpVars, $fileVars)
502506
echo json_encode($task);
503507
}
504508

505-
break;
509+
break;
506510

507511
default:
508-
break;
512+
break;
509513
}
510514
//var_dump($tasks);
511515

@@ -663,4 +667,4 @@ public function nextMinute($timeArray, &$a, &$m, &$j, &$h, &$min)
663667
if ($min == 60) { return -1; }
664668
} while ($valeurs[$min] != TRUE);
665669
}
666-
}
670+
}

core/src/plugins/auth.ldap/class.ldapAuthDriver.php

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,13 @@ public function getUserEntries($login = null, $countOnly = false, $offset = -1,
250250
}
251251

252252
if(isset($searchAttrArray)){
253-
if(count($searchAttrArray) > 1){
254-
$searchAttrFilter = "(|";
255-
foreach($searchAttrArray as $attr){
256-
$searchAttrFilter .= "(". $attr . "=" . $login . ")";
253+
if(count($searchAttrArray) > 1){
254+
$searchAttrFilter = "(|";
255+
foreach($searchAttrArray as $attr){
256+
$searchAttrFilter .= "(". $attr . "=" . $login . ")";
257257
}
258-
$searchAttrFilter .= ")";
259-
}
258+
$searchAttrFilter .= ")";
259+
}
260260
else{
261261
$searchAttrFilter = "(" . $searchAttrArray[0] . "=" . $login . ")";
262262
}
@@ -748,14 +748,15 @@ public function updateUserObject(&$userObject)
748748
$valueFilters = array_map("trim", explode(",", $filter));
749749
}
750750
if ($key == "memberof") {
751-
751+
if (empty($valueFilters)) {
752+
$valueFilters = $this->getLdapGroupListFromDN();
753+
}
752754
if ($this->mappedRolePrefix) {
753755
$rolePrefix = $this->mappedRolePrefix;
754756
} else {
755757
$rolePrefix = "";
756758
}
757759

758-
/*
759760
$userroles = $userObject->getRoles();
760761
//remove all mapped roles before
761762

@@ -767,7 +768,6 @@ public function updateUserObject(&$userObject)
767768
}
768769
}
769770
$userObject->recomputeMergedRole();
770-
*/
771771

772772
foreach ($memberValues as $uniqValue => $fullDN) {
773773
$uniqValueWithPrefix = $rolePrefix . $uniqValue;
@@ -914,4 +914,35 @@ public function saveCountToCache($fileContent)
914914
file_put_contents($this->getPluginCacheDir() . DIRECTORY_SEPARATOR . $fileName, serialize($fileContent));
915915
}
916916
}
917-
}
917+
918+
public function getLdapGroupListFromDN()
919+
{
920+
$origUsersDN = $this->ldapDN;
921+
$origUsersFilter = $this->ldapFilter;
922+
$origUsersAttr = $this->ldapUserAttr;
923+
$this->ldapDN = $this->ldapGDN;
924+
$this->ldapFilter = $this->ldapGFilter;
925+
$this->ldapUserAttr = $this->ldapGroupAttr;
926+
927+
$entries = $this->getUserEntries();
928+
$returnArray = array();
929+
if (is_array($entries) && $entries["count"] > 0) {
930+
unset($entries["count"]);
931+
foreach ($entries as $key => $entry) {
932+
if(isset($this->mappedRolePrefix)){
933+
$returnArray[$this->mappedRolePrefix . $entry[$this->ldapGroupAttr][0]] = $this->mappedRolePrefix . $entry[$this->ldapGroupAttr][0];
934+
}
935+
else{
936+
$returnArray[$entry[$this->ldapGroupAttr][0]] = $entry[$this->ldapGroupAttr][0];
937+
}
938+
}
939+
}
940+
941+
$this->dynamicFilter = null;
942+
$this->ldapDN = $origUsersDN;
943+
$this->ldapFilter = $origUsersFilter;
944+
$this->ldapUserAttr = $origUsersAttr;
945+
946+
return $returnArray;
947+
}
948+
}
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
<p>Authenticate user using <a href="http://www.jasig.org/cas" target="_top">CAS</a>.</p>
22

3-
<p>You have to set it up correctly in conf/bootstrap_plugins.php using the following keys in <var>$PLUGINS["AUTH_DRIVER"]["OPTIONS"]</var> array:</p>
4-
5-
<pre>
6-
CAS_SERVER: hostname of the CAS server (example: login.example.com)
7-
CAS_URI: URI where CAS server is installed on (example: /cas)
8-
CAS_PORT: port where CAS server is listening on waiting for connections
9-
USERS_FILEPATH: Inherited from auth.serial. File where user data is stored
10-
</pre>
3+
Authfront.cas is based on phpCAS library of JASIG that turns Pydio to be able be integrated into a SSO system.
4+
It can do the authentication on a remote server CAS by using two mode: client and proxy
5+
* In mode client, authfront.cas runs as a cas client to authenticate given user's credential to remote server CAS.
6+
* In mode proxy, it can provide additionally authentication service to another service such as smb/cifs or imap ...
7+
Note: The connection between pydio and cas normally is an ssl connection. Administrator must take attention on configuration of certificate and trusted relationship of two direction between Pydio server and CAS.
118

0 commit comments

Comments
 (0)