Subversion Repositories oidplus

Rev

Rev 447 | Rev 449 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 447 Rev 448
Line 142... Line 142...
142
                        self::$config->prepareConfigKey('global_cc', 'Global CC for all outgoing emails?', '', OIDplusConfig::PROTECTION_EDITABLE, function($value) {
142
                        self::$config->prepareConfigKey('global_cc', 'Global CC for all outgoing emails?', '', OIDplusConfig::PROTECTION_EDITABLE, function($value) {
143
                                if (!empty($value) && !OIDplus::mailUtils()->validMailAddress($value)) {
143
                                if (!empty($value) && !OIDplus::mailUtils()->validMailAddress($value)) {
144
                                        throw new OIDplusException(_L('This is not a correct email address'));
144
                                        throw new OIDplusException(_L('This is not a correct email address'));
145
                                }
145
                                }
146
                        });
146
                        });
-
 
147
                        self::$config->prepareConfigKey('design', 'Which design to use (must exist in plugins/design/)?', 'default', OIDplusConfig::PROTECTION_EDITABLE, function($value) {
-
 
148
                                $good = true;
-
 
149
                                if (strpos($value,'/') !== false) $good = false;
-
 
150
                                if (strpos($value,'\\') !== false) $good = false;
-
 
151
                                if (strpos($value,'..') !== false) $good = false;
-
 
152
                                if (!$good) {
-
 
153
                                        throw new OIDplusException(_L('Invalid design folder name. Do only enter a folder name, not an absolute or relative path'));
-
 
154
                                }
-
 
155
 
-
 
156
                                if (!is_dir(__DIR__.'/../../plugins/design/'.$value)) {
-
 
157
                                        throw new OIDplusException(_L('The design "%1" does not exist in plugin directory %2',$value,'plugins/design/'));
-
 
158
                                }
-
 
159
                        });
147
                        self::$config->prepareConfigKey('objecttypes_initialized', 'List of object type plugins that were initialized once', '', OIDplusConfig::PROTECTION_READONLY, function($value) {
160
                        self::$config->prepareConfigKey('objecttypes_initialized', 'List of object type plugins that were initialized once', '', OIDplusConfig::PROTECTION_READONLY, function($value) {
148
                                // Nothing here yet
161
                                // Nothing here yet
149
                        });
162
                        });
150
                        self::$config->prepareConfigKey('objecttypes_enabled', 'Enabled object types and their order, separated with a semicolon (please reload the page so that the change is applied)', '', OIDplusConfig::PROTECTION_EDITABLE, function($value) {
163
                        self::$config->prepareConfigKey('objecttypes_enabled', 'Enabled object types and their order, separated with a semicolon (please reload the page so that the change is applied)', '', OIDplusConfig::PROTECTION_EDITABLE, function($value) {
151
                                # TODO: when objecttypes_enabled is changed at the admin control panel, we need to do a reload of the page, so that jsTree will be updated. Is there anything we can do?
164
                                # TODO: when objecttypes_enabled is changed at the admin control panel, we need to do a reload of the page, so that jsTree will be updated. Is there anything we can do?
Line 729... Line 742...
729
                if (!isset($_SERVER["SCRIPT_NAME"])) return false;
742
                if (!isset($_SERVER["SCRIPT_NAME"])) return false;
730
 
743
 
731
                $test_dir = dirname($_SERVER['SCRIPT_FILENAME']);
744
                $test_dir = dirname($_SERVER['SCRIPT_FILENAME']);
732
                $test_dir = str_replace('\\', '/', $test_dir);
745
                $test_dir = str_replace('\\', '/', $test_dir);
733
                $c = 0;
746
                $c = 0;
-
 
747
                // We just assume that only the OIDplus base directory contains "oidplus.min.css.php" and not any subsequent directory!
734
                while (!file_exists($test_dir.'/oidplus_base.js')) {
748
                while (!file_exists($test_dir.'/oidplus.min.css.php')) {
735
                        $test_dir = dirname($test_dir);
749
                        $test_dir = dirname($test_dir);
736
                        $c++;
750
                        $c++;
737
                        if ($c == 1000) return false;
751
                        if ($c == 1000) return false;
738
                }
752
                }
739
 
753