- if (!in_array($values['site']['theme'], Theme::listAvailable())) {
- $this->clientError(sprintf(_("Theme not available: %s"), $values['site']['theme']));
- }
-
- // Make sure the directories are there
-
- if (!empty($values['theme']['dir']) && !is_readable($values['theme']['dir'])) {
- $this->clientError(sprintf(_("Theme directory not readable: %s"), $values['theme']['dir']));
- }
-
- if (empty($values['avatar']['dir']) || !is_writable($values['avatar']['dir'])) {
- $this->clientError(sprintf(_("Avatar directory not writable: %s"), $values['avatar']['dir']));
- }
-
- if (empty($values['background']['dir']) || !is_writable($values['background']['dir'])) {
- $this->clientError(sprintf(_("Background directory not writable: %s"), $values['background']['dir']));
- }
-
- // Do we need to do anything else but validate the
- // other fields for length? Design settings are
- // validated elsewhere --Z
-
- static $settings = array(
- 'theme' => array('server', 'path'),
- 'avatar' => array('server', 'path'),
- 'background' => array('server', 'path')
- );
-
- foreach ($settings as $section => $parts) {
- foreach ($parts as $setting) {
- if (mb_strlen($values[$section][$setting]) > 255) {
- $this->clientError(sprintf(_("Max length for %s %s is 255 characters."),
- $section, $setting));
- return;
- }
- }