Dotclear

source: plugins/socialLogin/_install.php @ 3102

Revision 3102, 1.3 KB checked in by nicofrand, 11 years ago (diff)

Version 1.0: Initial commit

Line 
1<?php
2/**
3 * This file is part of socialLogin, a plugin for Dotclear.
4 *
5 * @author Nicolas Frandeboeuf <nicofrand@gmail.com>
6 * @version 1.0
7 * @package socialLogin
8 * Licensed under the GPL version 3 license.
9 * http://www.gnu.org/licenses/gpl-3.0.html
10 */
11
12if (!defined("DC_CONTEXT_ADMIN"))
13    return;
14
15// We read the plugin version
16$m_version = $core->plugins->moduleInfo("socialLogin", "version");
17
18// We read the plugin version from the version database table
19$i_version = $core->getVersion("socialLogin");
20
21/**
22 * If the db version is greater or equals the module version, then the plugin
23 * is already installed and up to date.
24 */
25if (version_compare($i_version, $m_version, ">="))
26    return;
27
28
29if (!get_extension_funcs("curl"))
30{
31    // Load translations of alert messages
32    $_lang = $core->auth->getInfo("user_lang");
33    $_lang = preg_match("/^[a-z]{2}(-[a-z]{2})?$/", $_lang) ? $_lang : "en";
34    l10n::set(dirname(__FILE__) . "/../locales/" . $_lang . "/error");
35    throw new Exception(__("SocialLogin: curl lib needed."));
36}
37
38// Create the workspace
39$core->blog->settings->addNameSpace("socialLogin");
40$core->blog->settings->socialLogin->put("janrain_api_key", "", "string", "Janrain API Key");
41$core->blog->settings->socialLogin->put("janrain_app_domain", "", "string", "Janrain application domain");
42$core->setVersion("socialLogin", $m_version);
43?>
Note: See TracBrowser for help on using the repository browser.

Sites map