From bd731536951b183a7164a8fbfd489bb79e7bd862 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 18 Aug 2022 09:44:29 +0000 Subject: [PATCH] wait #5400 @0.5 --- inc/ws/Controlleur/class.ws.maintenance.php | 146 +------------------- 1 file changed, 4 insertions(+), 142 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index ccfddfa6d..a842503b9 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -388,155 +388,17 @@ class wsMaintenance } } - public static function syncLDAP() - { - global $core; - cubePHP::neverStop(); - - $res = '
';
-
-        $ds = ldap_connect('localhost', 10389);
-        ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
-        ldap_bind($ds, 'uid=admin,ou=system', '*arica*6');
-
-        $r = $core->con->select('SELECT * FROM utilisateurs_entreprise ORDER BY utilisateur_id');
-        while ($r->fetch()) {
-            if (is_null($r->utilisateur_id)) {
-                continue;
-            }
-            $entree = array();
-            $entree['objectClass'][] = 'top';
-            $entree['objectClass'][] = 'person';
-            $entree['objectClass'][] = 'organizationalPerson';
-            $entree['objectClass'][] = 'extensibleObject';
-            $entree['cn'] = trim($r->prenom . ' ' . $r->nom . ' - ' . $r->rs . ' (' . $r->utilisateur_id . ')', ' -');
-            $entree['sn'] = $r->nom == '' ? $entree['cn'] : $r->nom;
-            $entree['mail'] = $r->email;
-            $entree['uid'] = 'extranet_' . $r->utilisateur_id;
-            $entree['OrganizationalUnitName'] = $r->rs;
-            if ($r->telephone && $r->telephone != '+33') {
-                $entree['telephoneNumber'][] = $r->telephone;
-            }
-            if ($r->mobile && $r->mobile != '+33') {
-                $entree['telephoneNumber'][] = $r->mobile;
-            }
-            if ($r->fax && $r->fax != '+33') {
-                $entree['telexNumber'] = $r->fax;
-            }
-            $dn = 'uid=' . $entree['uid'] . ',o=cubedesigners';
-            if (!ldap_add($ds, $dn, $entree)) {
-                $e = ldap_error($ds);
-                if ($e == 'Already exists') {
-                    ldap_modify($ds, $dn, $entree);
-                } else {
-                    fb($entree, $e);
-                }
-            }
-        }
-        $res = 'test';
-        $res .= '
'; - - ldap_close($ds); - return $res; - } public static function createBranch($args) { - commonDroits::min(5); - $branch = $args[0]; - - self::updateHTML5Sources(); - $playerDir = WS_COMPILE_ASSETS . '/player/'; - $branchesDir = $playerDir . 'branches/'; - $git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5'); - echo $git->executeCmd('checkout -b ' . $branch); - $git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5'); - echo $git->executeCmd('push --set-upstream origin ' . $branch); - self::updateHTML5Sources(); - $git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5'); - echo $git->executeCmd('checkout master'); + header('Location: https://toolbox.fluidbook.com/tools/fluidbookbranchcreate'); + exit; } public static function deleteBranch($args) { - commonDroits::min(5); - $branch = trim($args[0]); - if ($branch == 'master' || !$branch) { - die('même pas en rêve'); - } - - self::updateHTML5Sources(); - - $playerDir = WS_COMPILE_ASSETS . '/player/'; - $branchesDir = $playerDir . 'branches/'; - $localDir = $playerDir . 'local/'; - - $git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5'); - echo $git->executeCmd('push --delete origin ' . $branch); - - `rm -rf $localDir$branch`; - `rm -rf $branchesDir$branch`; - - self::updateHTML5Sources(); - - self::resetPlayerVersion($branch); - } - - public static function updateHTML5Sources($args = array(), $externals = true) - { - $playerDir = WS_COMPILE_ASSETS . '/player/'; - $branchesDir = $playerDir . 'branches/'; - $localDir = $playerDir . 'local/'; - echo '
';
-        $git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5');
-        echo $git->executeCmd('stash save --keep-index');
-        $git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5');
-        echo $git->executeCmd('stash drop');
-        $git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5');
-        echo $git->executeCmd('pull --all');
-        $git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5');
-        echo $git->executeCmd('fetch --all --prune');
-        $git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5');
-        $b = $git->executeCmd('branch -r');
-        echo $b;
-        $bb = explode("\n", $b);
-        $branches = array();
-        foreach ($bb as $item) {
-            $item = trim($item);
-            if ($item == '') {
-                continue;
-            }
-            $e = explode('->', $item);
-            if (count($e) == 2) {
-                $item = $e[1];
-            } else {
-                $item = $e[0];
-            }
-            $e = explode("/", $item);
-            $branches[trim($e[1])] = true;
-        }
-        $branches = array_keys($branches);
-        foreach ($branches as $b) {
-            $gitsource = $branchesDir . $b;
-            $local = $localDir . $b;
-            echo '' . $b . '' . "\n";
-            if (!file_exists($branchesDir . $b)) {
-                $git = new CubeIT_CommandLine_Git($branchesDir);
-                echo $git->executeCmd('clone -b ' . $b . ' --single-branch git@git.cubedesigners.com:fluidbook-html5.git ' . $b);
-            }
-            if (!file_exists($local)) {
-                mkdir($local, 0777, true);
-                `cp -r $gitsource/* $local`;
-                `rm -rf $local/.git`;
-            }
-            $git = new CubeIT_CommandLine_Git($branchesDir . $b);
-            echo $git->executeCmd('reset --hard origin/' . $b);
-            $git = new CubeIT_CommandLine_Git($branchesDir . $b);
-            echo $git->executeCmd('pull');
-        }
-
-        echo '
'; - file_put_contents(WS_CACHE . '/activebranches', json_encode($branches)); + header('Location: https://toolbox.fluidbook.com/tools/fluidbookbranchremove'); + exit; } public static function cleanDownload($args) -- 2.39.5