Rev 1031 | Rev 1055 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1031 | Rev 1050 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | * See the License for the specific language governing permissions and |
16 | * See the License for the specific language governing permissions and |
17 | * limitations under the License. |
17 | * limitations under the License. |
18 | */ |
18 | */ |
19 | 19 | ||
- | 20 | use ViaThinkSoft\OIDplus\OIDplus; |
|
- | 21 | use ViaThinkSoft\OIDplus\OIDplusDatabasePlugin; |
|
- | 22 | use ViaThinkSoft\OIDplus\OIDplusSqlSlangPlugin; |
|
- | 23 | use ViaThinkSoft\OIDplus\OIDplusCaptchaPlugin; |
|
- | 24 | ||
20 | require_once __DIR__ . '/../includes/oidplus.inc.php'; |
25 | require_once __DIR__ . '/../includes/oidplus.inc.php'; |
21 | 26 | ||
22 | define('BASECONFIG_FILE', 'userdata/baseconfig/config.inc.php'); |
27 | define('BASECONFIG_FILE', 'userdata/baseconfig/config.inc.php'); |
23 | $already_setup = file_exists(__DIR__.'/../'.BASECONFIG_FILE); |
28 | $already_setup = file_exists(__DIR__.'/../'.BASECONFIG_FILE); |
24 | 29 | ||
Line 88... | Line 93... | ||
88 | echo '<p><a href="../doc/database_connectivity_diagram.png" target="_blank"><img src="../doc/database_connectivity_diagram.png" width="20%" alt="'._L('Database connectivity diagram').'" title="'._L('Database connectivity diagram').'"></a></p>'; |
93 | echo '<p><a href="../doc/database_connectivity_diagram.png" target="_blank"><img src="../doc/database_connectivity_diagram.png" width="20%" alt="'._L('Database connectivity diagram').'" title="'._L('Database connectivity diagram').'"></a></p>'; |
89 | } |
94 | } |
90 | 95 | ||
91 | echo _L('Database plugin').': <select name="db_plugin" onChange="dbplugin_changed()" id="db_plugin">'; |
96 | echo _L('Database plugin').': <select name="db_plugin" onChange="dbplugin_changed()" id="db_plugin">'; |
92 | 97 | ||
93 | OIDplus::registerAllPlugins('database', 'OIDplusDatabasePlugin', array('OIDplus','registerDatabasePlugin')); |
98 | OIDplus::registerAllPlugins('database', OIDplusDatabasePlugin::class, array(OIDplus::class,'registerDatabasePlugin')); |
94 | foreach (OIDplus::getDatabasePlugins() as $plugin) { |
99 | foreach (OIDplus::getDatabasePlugins() as $plugin) { |
95 | $selected = $plugin::id() == 'MySQL' ? ' selected="true"' : ''; |
100 | $selected = $plugin::id() == 'MySQL' ? ' selected="true"' : ''; |
96 | echo '<option value="'.htmlentities($plugin::id()).'"'.$selected.'>'.htmlentities($plugin::id()).'</option>'; |
101 | echo '<option value="'.htmlentities($plugin::id()).'"'.$selected.'>'.htmlentities($plugin::id()).'</option>'; |
97 | } |
102 | } |
98 | 103 | ||
99 | echo '</select>'; |
104 | echo '</select>'; |
100 | 105 | ||
101 | echo '<div style="margin-left:50px">'; |
106 | echo '<div style="margin-left:50px">'; |
102 | 107 | ||
103 | OIDplus::registerAllPlugins('sqlSlang', 'OIDplusSqlSlangPlugin', array('OIDplus','registerSqlSlangPlugin')); |
108 | OIDplus::registerAllPlugins('sqlSlang', OIDplusSqlSlangPlugin::class, array(OIDplus::class,'registerSqlSlangPlugin')); |
104 | $sql_slang_selection = array(); |
109 | $sql_slang_selection = array(); |
105 | foreach (OIDplus::getSqlSlangPlugins() as $plugin) { |
110 | foreach (OIDplus::getSqlSlangPlugins() as $plugin) { |
106 | $slang_id = $plugin::id(); |
111 | $slang_id = $plugin::id(); |
107 | $pluginManifest = $plugin->getManifest(); |
112 | $pluginManifest = $plugin->getManifest(); |
108 | $human_friendly_name = empty($pluginManifest->getName()) ? get_class($plugin) : $pluginManifest->getName(); |
113 | $human_friendly_name = empty($pluginManifest->getName()) ? get_class($plugin) : $pluginManifest->getName(); |
109 | $sql_slang_selection[] = '<option value="'.$slang_id.'">'.$human_friendly_name.'</option>'; |
114 | $sql_slang_selection[] = '<option value="'.$slang_id.'">'.$human_friendly_name.'</option>'; |
110 | } |
115 | } |
111 | $sql_slang_selection = implode("\n", $sql_slang_selection); |
116 | $sql_slang_selection = implode("\n", $sql_slang_selection); |
112 | 117 | ||
113 | $found_db_plugins = 0; |
118 | $found_db_plugins = 0; |
114 | //OIDplus::registerAllPlugins('database', 'OIDplusDatabasePlugin', array('OIDplus','registerDatabasePlugin')); |
119 | //OIDplus::registerAllPlugins('database', OIDplusDatabasePlugin::class, array(OIDplus::class,'registerDatabasePlugin')); |
115 | foreach (OIDplus::getDatabasePlugins() as $plugin) { |
120 | foreach (OIDplus::getDatabasePlugins() as $plugin) { |
116 | $found_db_plugins++; |
121 | $found_db_plugins++; |
117 | $cont = $plugin->setupHTML(); |
122 | $cont = $plugin->setupHTML(); |
118 | $cont = str_replace('<!-- %SQL_SLANG_SELECTION% -->', $sql_slang_selection, $cont); |
123 | $cont = str_replace('<!-- %SQL_SLANG_SELECTION% -->', $sql_slang_selection, $cont); |
119 | echo $cont; |
124 | echo $cont; |
Line 133... | Line 138... | ||
133 | 138 | ||
134 | // TODO: Add a small explanation here, in case somebody does not know what CAPTCHA is |
139 | // TODO: Add a small explanation here, in case somebody does not know what CAPTCHA is |
135 | 140 | ||
136 | echo _L('CAPTCHA plugin').': <select name="captcha_plugin" onChange="captchaplugin_changed()" id="captcha_plugin">'; |
141 | echo _L('CAPTCHA plugin').': <select name="captcha_plugin" onChange="captchaplugin_changed()" id="captcha_plugin">'; |
137 | 142 | ||
138 | OIDplus::registerAllPlugins('captcha', 'OIDplusCaptchaPlugin', array('OIDplus','registerCaptchaPlugin')); |
143 | OIDplus::registerAllPlugins('captcha', OIDplusCaptchaPlugin::class, array(OIDplus::class,'registerCaptchaPlugin')); |
139 | foreach (OIDplus::getCaptchaPlugins() as $plugin) { |
144 | foreach (OIDplus::getCaptchaPlugins() as $plugin) { |
140 | $selected = strtolower($plugin::id()) === strtolower('None') ? ' selected="true"' : ''; // select "None" by default |
145 | $selected = strtolower($plugin::id()) === strtolower('None') ? ' selected="true"' : ''; // select "None" by default |
141 | echo '<option value="'.htmlentities($plugin::id()).'"'.$selected.'>'.htmlentities($plugin::id()).'</option>'; |
146 | echo '<option value="'.htmlentities($plugin::id()).'"'.$selected.'>'.htmlentities($plugin::id()).'</option>'; |
142 | } |
147 | } |
143 | 148 |