aboutsummaryrefslogtreecommitdiffstats
path: root/egyéb/nextcloud
diff options
context:
space:
mode:
authorM.Gergo2020-03-31 02:23:00 +0200
committerM.Gergo2020-03-31 02:23:00 +0200
commitad443e927baacbf809f8711907f5286fbb148b41 (patch)
treeee5267890a244cbe167d5d6a89192eb671374c05 /egyéb/nextcloud
parentf66cfd50ed05670942d931fa8dc5466d890316ca (diff)
downloadmayor-ad443e927baacbf809f8711907f5286fbb148b41.tar.gz
mayor-ad443e927baacbf809f8711907f5286fbb148b41.zip
Mayor-Nextcloud script: csoportmappa
Diffstat (limited to 'egyéb/nextcloud')
-rw-r--r--egyéb/nextcloud/mayor-nextcloud.php25
1 files changed, 14 insertions, 11 deletions
diff --git a/egyéb/nextcloud/mayor-nextcloud.php b/egyéb/nextcloud/mayor-nextcloud.php
index ebaea7ec..b7ce40ca 100644
--- a/egyéb/nextcloud/mayor-nextcloud.php
+++ b/egyéb/nextcloud/mayor-nextcloud.php
@@ -411,7 +411,7 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im
function clean_dir($user, $path, $tankorei){
global $occ_user, $occ_path, $log, $m2n;
$listdir = scan_dir($user, $path);
- $ret = array(false, false);
+ $ret = array(false, false); //Ez a $ret még nem igazán valid
foreach($listdir as $key => $val) {
if((!in_array(basename($val, '.please-remove'), $tankorei) || !is_dir($occ_path."/data/".$user."/files/".$path."/".$val)) && $val != "INFO.txt"){ //Nincs a tanköreiben, akkor törölni kell (de csak ha üres)
@@ -428,6 +428,7 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im
}
}
}
+ return $ret;
}
@@ -462,9 +463,11 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im
$ret = array();
if(($groupdir_user === "" || ($groupdir_user !== "" && $user == $groupdir_user)) && $oktId > 0 && $m2n['manage_groupdirs'] === true){
if(isset($tankrei)) {
- $ret = clean_dir($user, $path, $tankorei);
+ clean_dir($user, $path, $tankorei);
+ $ret[0] = true;
}
files_scan($user, $path); // Tankörmappa gyökér létrehozása
+ $ret[3] = true;
}
return $ret;
}
@@ -836,8 +839,8 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im
}
//------------------------- Tankörmappa györkér + info.txt ------------------------//
$ret = groupdir_create_root($curr, $curr_tanarId, $m2n['groupdir_prefix']);
- if ($ret[0] === true && $log['verbose'] > 2 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tLétrehozva :".po("\t$path",$m2n['csoportnev_hossz'],1)."\tcsoportmappa gyökér.\n";}
- if ($ret[1] > 0 && $log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tLétrehozva :".po("\t$path/INFO.txt",$m2n['csoportnev_hossz'],1)."\tfájl.\n";}
+ if ($ret[0] === true && $log['verbose'] > 2 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tLétrehozva :".po("\t".$m2n['groupdir_prefix'],$m2n['csoportnev_hossz'],1)."\tcsoportmappa gyökér.\n";}
+ if ($ret[1] > 0 && $log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tLétrehozva :".po("\t". $m2n['groupdir_prefix']."/INFO.txt",$m2n['csoportnev_hossz'],1)."\tfájl.\n";}
//------------------------------------------ Tankörök egyeztetése -------------------------------------------//
foreach($nxt_group as $key3 => $val3){ //A tankörök egyeztetése
@@ -851,7 +854,7 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im
//------------------------------- Tankörmappa -----------------------------// //( "_" --> mindenkinek, "username" --> csak neki ) && tanár
if($key3 != $m2n['mindenki_tanar'] && $key3 != $m2n['mindenki_diak'] && $key3 != $m2n['mindenki_tanar']){ //Ezekre a csoportokra minek?
$ret = groupdir_create_groupdir($curr, $curr_tanarId, $m2n['groupdir_prefix']."/".$key3);
- if ($ret === true && $log['verbose'] > 2 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tLétrehozva :".po("\t$key3",$m2n['csoportnev_hossz'],1)."\tcsoportmappa.\n";}
+ if ($ret === true && $log['verbose'] > 2 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tLétrehozva :".po("\t$key3",$m2n['csoportnev_hossz'],1)."\t".$m2n['groupdir_prefix']."\n";}
}
//------------------------------------- Tankör (Csoportból) törlés -------------------------//
@@ -864,9 +867,9 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im
}
//------------------------------------- Tankörmappa törlés + NXT-rescan ----------------------------------// //( "_" --> mindenkinek, "username" --> csak neki ) && tanár
- groupdir_finish($curr, $curr_tanarId, $m2n['groupdir_prefix'], $tankorei);
- if ($log['verbose'] > 2 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tKitisztítva:".po("\t".$m2n['groupdir_prefix'], $m2n['csoportnev_hossz'],1)."\tcsoportmappa.\n";}
- if ($log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tNXT-rescan :".po("\t".$m2n['groupdir_prefix'], $m2n['csoportnev_hossz'],1)."\tcsoportmappa.\n";}
+ $ret = groupdir_finish($curr, $curr_tanarId, $m2n['groupdir_prefix'], $tankorei);
+ if ($ret[0] === true && $log['verbose'] > 2 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tKitisztítva:".po("\t".$m2n['groupdir_prefix'], $m2n['csoportnev_hossz'],1)."\t".$m2n['groupdir_prefix']."\n";}
+ if ($ret[3] === true && $log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tNXT-rescan :".po("\t".$m2n['groupdir_prefix'], $m2n['csoportnev_hossz'],1)."\t".$m2n['groupdir_prefix']."\n";}
break;
}
@@ -888,12 +891,12 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im
if ($log['verbose'] > 2 ){ echo "* -\t\tHozzáadva a:".po("\t $val3",$m2n['csoportnev_hossz'],1)."\tcsoporthoz.\n"; }
if($key3 != $m2n['mindenki_tanar'] && $key3 != $m2n['mindenki_diak'] && $key3 != $m2n['mindenki_tanar']){ //Ezekre a csoportokra minek?
$ret = groupdir_create_groupdir($curr, $curr_tanarId, $m2n['groupdir_prefix']."/".$key3);
- if ($ret === true && $log['verbose'] > 2 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tLétrehozva :".po("\t$key3",$m2n['csoportnev_hossz'],1)."\tcsoportmappa.\n";}
+ if ($ret === true && $log['verbose'] > 2 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tLétrehozva :".po("\t$key3",$m2n['csoportnev_hossz'],1)."\t".$m2n['groupdir_prefix']."\n";}
}
}
}
- groupdir_finish($curr, $curr_tanarId, $m2n['groupdir_prefix'], null);
- if ($log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tNXT-rescan :".po("\t".$m2n['groupdir_prefix'], $m2n['csoportnev_hossz'],1)."\tcsoportmappa.\n";}
+ $ret = groupdir_finish($curr, $curr_tanarId, $m2n['groupdir_prefix'], null);
+ if ($ret[3] === true && $log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tNXT-rescan :".po("\t".$m2n['groupdir_prefix'], $m2n['csoportnev_hossz'],1)."\tcsoportmappa.\n";}