This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  beddd5d1899b7531a430f0b920ecf0c589fda808 (commit)
      from  1f935eaf75ae965ac52eb2c114c7c28e55dc45af (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=beddd5d1899b7531a430f0b920ecf0c589fda808

commit beddd5d1899b7531a430f0b920ecf0c589fda808
Author: Franck Villaume <[email protected]>
Date:   Sat Jul 8 17:36:10 2017 +0200

    coding style

diff --git a/src/cronjobs/ftp/ftp_create_group_access.php 
b/src/cronjobs/ftp/ftp_create_group_access.php
index ca729cc..431efd4 100755
--- a/src/cronjobs/ftp/ftp_create_group_access.php
+++ b/src/cronjobs/ftp/ftp_create_group_access.php
@@ -2,8 +2,8 @@
 <?php
 /**
  *
- * Fabio Bertagnin nov 2005
- * [email protected]
+ * Copyright 2005, Fabio Bertagnin ([email protected])
+ * Copyright 2017, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -29,49 +29,46 @@ $users = array();
 $ftp_dir = forge_get_config('ftp_upload_dir');
 $home_dir = forge_get_config('homedir_prefix');
 
-$res_db = db_query_params ('SELECT user_id FROM users WHERE unix_status=$1',
-                          array ('A'));
+$res_db = db_query_params('SELECT user_id FROM users WHERE unix_status=$1', 
array ('A'));
 if ($res_db) {
-        while($e = db_fetch_array($res_db)) {
-                $users[] = user_get_object ($e['user_id']) ;
-        }
+       while($e = db_fetch_array($res_db)) {
+               $users[] = user_get_object ($e['user_id']) ;
+       }
 }
 
 foreach ($users as $u) {
-        $dir = $home_dir.'/'.$u->getUnixName().'/pub';
-        if (is_dir("$home_dir".$u->getUnixName())) {
-                foreach ($u->getGroups() as $project) {
+       $dir = $home_dir.'/'.$u->getUnixName().'/pub';
+       if (is_dir("$home_dir".$u->getUnixName())) {
+               foreach ($u->getGroups() as $project) {
                        $g = $project->getUnixName();
-                        if (is_dir($ftp_dir.'/'.$g)) {
-                                if (is_dir($dir.'/'.$g)) {
-                                        $cmd = '/bin/umount '.$dir.'/'.$g;
-                                        $res = execute($cmd);
-                                        $cmd = '/bin/rmdir '.$dir.'/'.$g;
-                                        $res = execute($cmd);
-                                }
-                                if (!is_dir($dir)) {
-                                        $cmd = '/bin/mkdir '.$dir;
-                                        $res = execute($cmd);
-                                }
-                                $cmd = '/bin/mkdir '.$dir.'/'.$g;
-                                $res = execute($cmd);
-                                $cmd = '/bin/mount --bind '.$ftp_dir.'/'.$g 
$dir.'/'.$g;
-                                $res = execute($cmd);
-                                echo 'allow '.$u->getUnixName().' to access at 
'.$dir.'/'.$g."\n";
-                        }
-                }
-        }
+                       if (is_dir($ftp_dir.'/'.$g)) {
+                               if (is_dir($dir.'/'.$g)) {
+                                       $cmd = '/bin/umount '.$dir.'/'.$g;
+                                       $res = execute($cmd);
+                                       $cmd = '/bin/rmdir '.$dir.'/'.$g;
+                                       $res = execute($cmd);
+                               }
+                               if (!is_dir($dir)) {
+                                       $cmd = '/bin/mkdir '.$dir;
+                                       $res = execute($cmd);
+                               }
+                               $cmd = '/bin/mkdir '.$dir.'/'.$g;
+                               $res = execute($cmd);
+                               $cmd = '/bin/mount --bind '.$ftp_dir.'/'.$g 
$dir.'/'.$g;
+                               $res = execute($cmd);
+                               echo 'allow '.$u->getUnixName().' to access at 
'.$dir.'/'.$g."\n";
+                       }
+               }
+       }
 }
 
-function print_debug($text)
-{
-        echo "$text\n";
+function print_debug($text) {
+       echo "$text\n";
 }
 
-function execute($cmd)
-{
-        // print_debug ("cmd= ".$cmd);
-        $res = shell_exec($cmd);
-        // print_debug ("res= ".$res);
-        return $res;
+function execute($cmd) {
+       // print_debug ("cmd= ".$cmd);
+       $res = shell_exec($cmd);
+       // print_debug ("res= ".$res);
+       return $res;
 }

-----------------------------------------------------------------------

Summary of changes:
 src/cronjobs/ftp/ftp_create_group_access.php | 73 +++++++++++++---------------
 1 file changed, 35 insertions(+), 38 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to