[evolvis-commits] r9859: Add a new function to Group.class to allow groupedit. php editing the SCM_BOX.=?UTF-8?Q?=E2=86=B5=20Fixes=20?=[#858] ↵
mirabilos at evolvis.org
mirabilos at evolvis.org
Thu Feb 24 17:32:41 CET 2011
Author: mirabilos
Date: 2011-02-24 17:32:41 +0100 (Thu, 24 Feb 2011)
New Revision: 9859
Modified:
trunk/gforge_base/evolvisforge-5.1/gforge/common/include/Group.class
Log:
Add a new function to Group.class to allow groupedit.php editing the SCM_BOX.
Fixes [#858]
Modified: trunk/gforge_base/evolvisforge-5.1/gforge/common/include/Group.class
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/common/include/Group.class 2011-02-24 16:32:40 UTC (rev 9858)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/common/include/Group.class 2011-02-24 16:32:41 UTC (rev 9859)
@@ -811,6 +811,30 @@
return $this->data_array['scm_box'];
}
}
+ /**
+ * setSCMBox - the hostname of the scm box where this project is located.
+ *
+ * @param string The name of the new SCM_BOX
+ */
+ function setSCMBox($scm_box) {
+ if ( $GLOBALS['sys_scm_single_host'] == '1' ) {
+ $this->setError('Trying to change SCM_BOX when sys_scm_single_host selected');
+ } else {
+ db_begin();
+ $sql = "UPDATE groups SET scm_box = '$scm_box' WHERE group_id = ".$this->getID();
+ var_dump($sql);
+ $res = db_query($sql);
+ if ($res) {
+ $this->data_array['scm_box']=$scm_box;
+ db_commit();
+ return true;
+ } else {
+ db_rollback();
+ $this->setError('Couldn\'t insert SCM_BOX to database');
+ return false;
+ }
+ }
+ }
/**
* getDomain - the hostname.domain where their web page is located.
More information about the evolvis-commits
mailing list