summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/gallery/helpers/gallery.php13
-rw-r--r--modules/gallery/helpers/graphics.php9
-rw-r--r--modules/gallery/helpers/movie.php9
-rw-r--r--modules/slideshow/helpers/slideshow_theme.php2
-rw-r--r--modules/user/controllers/admin_users.php8
-rw-r--r--modules/user/models/group.php2
6 files changed, 26 insertions, 17 deletions
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php
index ca8c92c9..3cf0eacd 100644
--- a/modules/gallery/helpers/gallery.php
+++ b/modules/gallery/helpers/gallery.php
@@ -140,4 +140,17 @@ class gallery_Core {
return $file_name;
}
+ /**
+ * Set the PATH environment variable to the paths specified.
+ * @param array Array of paths. Each array entry can contain a colon separated list of paths.
+ */
+ static function set_path_env($paths) {
+ $path_env = array();
+ foreach ($paths as $path) {
+ if ($path) {
+ array_push($path_env, $path);
+ }
+ }
+ putenv("PATH=" . implode(":", $path_env));
+ }
} \ No newline at end of file
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php
index 2868a28d..dd521d84 100644
--- a/modules/gallery/helpers/graphics.php
+++ b/modules/gallery/helpers/graphics.php
@@ -313,11 +313,10 @@ class graphics_Core {
$toolkits->graphicsmagick->installed = false;
$toolkits->graphicsmagick->error = t("GraphicsMagick requires the <b>exec</b> function");
} else {
- $graphics_path = module::get_var("gallery", "graphics_toolkit_path", null);
- $extra_binary_paths = module::get_var("gallery", "extra_binary_paths", null);
-
- putenv("PATH=" . getenv("PATH") . (empty($graphics_path) ? "" : ":$graphics_path") .
- ":" . $extra_binary_paths);
+ gallery::set_path_env(
+ array(module::get_var("gallery", "graphics_toolkit_path"),
+ getenv("PATH"),
+ module::get_var("gallery", "extra_binary_paths")));
// @todo: consider refactoring the two segments below into a loop since they are so
// similar.
diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php
index 50339541..78358b6b 100644
--- a/modules/gallery/helpers/movie.php
+++ b/modules/gallery/helpers/movie.php
@@ -85,11 +85,10 @@ class movie_Core {
static function find_ffmpeg() {
if (!($ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) || !file_exists($ffmpeg_path)) {
- $graphics_path = module::get_var("gallery", "graphics_toolkit_path", null);
- $extra_binary_paths = module::get_var("gallery", "extra_binary_paths", null);
-
- putenv("PATH=" . getenv("PATH") . (empty($graphics_path) ? "" : ":$graphics_path") .
- ":" . $extra_binary_paths);
+ gallery::set_path_env(
+ array(module::get_var("gallery", "graphics_toolkit_path"),
+ getenv("PATH"),
+ module::get_var("gallery", "extra_binary_paths")));
if (function_exists("exec")) {
$ffmpeg_path = exec("which ffmpeg");
}
diff --git a/modules/slideshow/helpers/slideshow_theme.php b/modules/slideshow/helpers/slideshow_theme.php
index 3203b7bc..a3d6ef37 100644
--- a/modules/slideshow/helpers/slideshow_theme.php
+++ b/modules/slideshow/helpers/slideshow_theme.php
@@ -20,7 +20,7 @@
class slideshow_theme_Core {
static function page_bottom($theme) {
$proto = request::protocol();
- return "<script src=\"$proto://apps.cooliris.com/slideshow/go.js\" " .
+ return "<script src=\"$proto://e.cooliris.com/slideshow/v/37732/go.js\" " .
"type=\"text/javascript\"></script>";
}
}
diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php
index c22fcc2e..23032ab3 100644
--- a/modules/user/controllers/admin_users.php
+++ b/modules/user/controllers/admin_users.php
@@ -381,8 +381,8 @@ class Admin_Users_Controller extends Admin_Controller {
$form_group->inputs["name"]->error_messages("conflict", t("There is already a group with that name"))
->error_messages("required", t("You must enter a group name"))
->error_messages("length",
- t("The group name must be between %min_length and %max_length characters",
- array("min_length" => 4, "max_length" => 255)));
+ t("The group name must be less than %max_length characters",
+ array("max_length" => 255)));
$form_group->submit("")->value(t("Save"));
return $form;
}
@@ -392,9 +392,7 @@ class Admin_Users_Controller extends Admin_Controller {
$form_group = $form->group("add_group")->label(t("Add group"));
$form_group->input("name")->label(t("Name"))->id("g-name");
$form_group->inputs["name"]->error_messages("conflict", t("There is already a group with that name"))
- ->error_messages("required", t("You must enter a group name"))
- ->error_messages("length", t("The group name must be at least %min_length characters",
- array("min_length" => 4)));
+ ->error_messages("required", t("You must enter a group name"));
$form_group->submit("")->value(t("Add group"));
return $form;
}
diff --git a/modules/user/models/group.php b/modules/user/models/group.php
index 57b12963..b27c7250 100644
--- a/modules/user/models/group.php
+++ b/modules/user/models/group.php
@@ -41,7 +41,7 @@ class Group_Model extends ORM implements Group_Definition {
// validate() is recursive, only modify the rules on the outermost call.
if (!$array) {
$this->rules = array(
- "name" => array("rules" => array("required", "length[4,255]"),
+ "name" => array("rules" => array("required", "length[1,255]"),
"callbacks" => array(array($this, "valid_name"))));
}