From 6aa22d4af60e348b40f4094d2f33ec3523d5999a Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Sat, 4 Apr 2020 18:14:49 +0200 Subject: Mayor-Nextcloud script: Tankörmappák --- "egy\303\251b/nextcloud/mayor-nextcloud.php" | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git "a/egy\303\251b/nextcloud/mayor-nextcloud.php" "b/egy\303\251b/nextcloud/mayor-nextcloud.php" index a90cee78..926624b5 100644 --- "a/egy\303\251b/nextcloud/mayor-nextcloud.php" +++ "b/egy\303\251b/nextcloud/mayor-nextcloud.php" @@ -357,11 +357,10 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im $ret = null; if(!file_exists($occ_path."/data/".$user."/files/".$path)){ // Ha Még nem létezik $ret = @mkdir($occ_path."/data/".$user."/files/".$path, 0755, true); // Akkor létrehozza - if($ret === true && $log['verbose'] > 5) { echo "php ->\tDIR: \"".$occ_path."/data/".$user."/files/".$path."\" \t created.\n"; } - if($ret === false && $log['verbose'] > -1) { echo "php ->\tDIR: \"".$occ_path."/data/".$user."/files/".$path."\" \t makedir failed!!\n"; } chown($occ_path."/data/".$user."/files/".$path, $occ_user); chgrp($occ_path."/data/".$user."/files/".$path, $occ_user); - if($log['verbose'] > 5) { echo "php ->\tDIR: \"".$occ_path."/data/".$user."/files/".$path."\" \t created.\n"; } + if($ret === true && $log['verbose'] > 5) { echo "php ->\tDIR: \"".$occ_path."/data/".$user."/files/".$path."\" \t created.\n"; } + if($ret === false && $log['verbose'] > -1) { echo "php ->\tDIR: \"".$occ_path."/data/".$user."/files/".$path."\" \t makedir failed!!\n"; } //mondjuk ilyen egyáltalán mikor lehet? } return $ret; } @@ -454,7 +453,7 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im files_scan($user, "" ); //Ekkor az egész $user/files mappát szkenneli } $ret[0] = create_dir($user, $path); // Tankörmappa gyökér létrehozása - $ret[1] = write_tofile($user, $path."/"."INFO.txt", $m2n['infotxt_szöveg']); // Információs fájlt is + $ret[1] = write_tofile($user, $path."/"."INFO.txt", $m2n['infotxt_szöveg']); // INFO.txt (Újra)Írása. if($ret[0] === true){ // Ha frissen létrehozott mappa, akkor az egész userre kell jogot adni $e = "/bin/chown -R '".$occ_user.":".$occ_user."' '".$occ_path."/data/".$user."/'"; if($log['verbose'] > 5) { echo "bash ->\t".$e."\n"; } @@ -487,7 +486,6 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im $ret = clean_dir($user, $path, $tankorei); $ret[3] = false; //mert felülírja a skeleton-t } -// $ret[3] = write_tofile($user, $path."/"."INFO.txt", $m2n['infotxt_szöveg']); //INFO.txt újraírása if(!empty($ret[0]) or !empty($ret[1]) ){ files_scan($user, $path); // Nextcloud értesítése $ret[3] = true; @@ -902,12 +900,11 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im if (count($ret[0]) > 0 && $log['verbose'] > 2 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} foreach($ret[0] as $retkey => $retval){ echo "* -\t Üres (Tankör)mappa:".po("\t/".$retval."/", $m2n['csoportnev_hossz'],1)."\t./".$curr."/files/".$m2n['groupdir_prefix']."/ mappából törölve.\n";}} if (count($ret[1]) > 0 && $log['verbose'] > 2 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} foreach($ret[1] as $retkey => $retval){ echo "* -\tFájl/Mappa Átnevezve:".po("\t/".$retval."/", $m2n['csoportnev_hossz'],1)."\t./".$curr."/files/".$m2n['groupdir_prefix']."/ mappában.\n";}} if (count($ret[2]) > 0 && $log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} foreach($ret[2] as $retkey => $retval){ echo "* -\t\tTankörmappa:".po("\t/".$retval."/", $m2n['csoportnev_hossz'],1)."\t./".$curr."/files/".$m2n['groupdir_prefix']."/ mappában békén hagyva.\n";}} - if ($ret[3] > 0 && $log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tÚjraírva :".po("\t./".$curr."/files/". $m2n['groupdir_prefix']."/INFO.txt",$m2n['csoportnev_hossz'],1)."\tfájl.\n"; } - if ($ret[4] === true && $log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tNXT-rescan :".po("\t./".$curr."/files/".$m2n['groupdir_prefix']."/", $m2n['csoportnev_hossz'],1)."\t mappán.\n";} + if ($ret[3] === true && $log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tNXT-rescan :".po("\t./".$curr."/files/".$m2n['groupdir_prefix']."/", $m2n['csoportnev_hossz'],1)."\t mappán.\n";} break; } - } + } unset($nxt_user[$curr]); //Felhasználó Megvizsgálva, többször már nem kell dönteni róla. if($curr != $key2 and $curr != null){ //Nincs még ilyen felhasználó @@ -930,8 +927,7 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im } } $ret = groupdir_finish($curr, $curr_tanarId, $m2n['groupdir_prefix'], null); - if ($ret[3] > 0 && $log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tÚjraírva :".po("\t./".$curr."/files/". $m2n['groupdir_prefix']."/INFO.txt",$m2n['csoportnev_hossz'],1)."\tfájl.\n";} - if ($ret[4] === true && $log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tNXT-rescan :".po("\t./".$curr."/files/".$m2n['groupdir_prefix']."/", $m2n['csoportnev_hossz'],1)."\t mappán.\n";} + if ($ret[3] === true && $log['verbose'] > 3 ){if($log['curr'] !== ""){echo "**".$log['curr'];$log['curr'] = "";} echo "* -\t\tNXT-rescan :".po("\t./".$curr."/files/".$m2n['groupdir_prefix']."/", $m2n['csoportnev_hossz'],1)."\t mappán.\n";} if($curr_diakId > 0) { //Ennyi is elég // Diákról van szó /// if($curr_tanarId < 0 && $curr_diakId > 0) -- cgit v1.2.3