[evolvis-commits] r11070: *** empty log message ***↵
mirabilos at evolvis.org
mirabilos at evolvis.org
Thu Feb 24 18:01:22 CET 2011
Author: mirabilos
Date: 2011-02-24 18:01:22 +0100 (Thu, 24 Feb 2011)
New Revision: 11070
Added:
trunk/gforge_base/evolvisforge-5.1/gforge/cronjobs/cvs-cron/ftp_create.php
Log:
*** empty log message ***
Added: trunk/gforge_base/evolvisforge-5.1/gforge/cronjobs/cvs-cron/ftp_create.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/cronjobs/cvs-cron/ftp_create.php (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/cronjobs/cvs-cron/ftp_create.php 2011-02-24 17:01:22 UTC (rev 11070)
@@ -0,0 +1,59 @@
+#! /usr/bin/php4 -f
+<?php
+/**
+ * GForge Cron Job
+ *
+ * The rest Copyright 2002-2005 (c) GForge Team
+ * http://gforge.org/
+ *
+ * @version $Id$
+ *
+ * This file is part of GForge.
+ *
+ * GForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ This file creates the root directories for the FTP
+*/
+require_once('squal_pre.php');
+require ('common/include/cron_utils.php');
+
+$err = '';
+
+if ($sys_use_ftpuploads) {
+ //
+ // Add the groups from the gforge database
+ //
+ $res=db_query("SELECT group_id,unix_group_name FROM groups WHERE status='A' AND type_id='1'");
+ for($i = 0; $i < db_numrows($res); $i++) {
+ $groups[] = db_result($res,$i,'unix_group_name');
+ }
+
+ //
+ // Create home dir for groups
+ //
+ foreach($groups as $group) {
+
+ //create an FTP upload dir for this project
+ $destdir = $sys_ftp_upload_dir.'/'.$group;
+ if (!is_dir($destdir)) {
+ if (!@mkdir($destdir)) {
+ $err .= 'Could not create dir: '.$destdir."\n";
+ }
+ }
+ }
+}
+?>
More information about the evolvis-commits
mailing list