]> _ Git - cubeextranet.git/commitdiff
wait #5400 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 18 Aug 2022 09:44:29 +0000 (09:44 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 18 Aug 2022 09:44:29 +0000 (09:44 +0000)
inc/ws/Controlleur/class.ws.maintenance.php

index ccfddfa6dbdc58481a85e062ccdc71446f74167c..a842503b9dc3f7c64af2ca3b5784e315fc5d1d04 100644 (file)
@@ -388,155 +388,17 @@ class wsMaintenance
         }
     }
 
-    public static function syncLDAP()
-    {
-        global $core;
-        cubePHP::neverStop();
-
-        $res = '<pre>';
-
-        $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 .= '</pre>';
-
-        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 '<pre>';
-        $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>' . $b . '</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 '</pre>';
-        file_put_contents(WS_CACHE . '/activebranches', json_encode($branches));
+        header('Location: https://toolbox.fluidbook.com/tools/fluidbookbranchremove');
+        exit;
     }
 
     public static function cleanDownload($args)