Beispiel #1
0
function fn_twg_validate_auth()
{
    return Twigmo::validateAuth(md5(TwigmoSettings::get('my_public_key'))) || fn_twg_allow_request();
}
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
if (!defined('AREA')) {
    die('Access denied');
}
use Twigmo\Twigmo;
use Twigmo\Upgrade\TwigmoUpgrade;
use Twigmo\Core\Functions\Image\TwigmoImage;
use Tygh\Registry;
use Twigmo\Core\TwigmoSettings;
use Twigmo\Core\TwigmoConnector;
if (!empty($_REQUEST['addon']) && $_REQUEST['addon'] == 'twigmo' && $mode != 'uninstall') {
    $twigmo_requirements_errors = Twigmo::checkRequirements();
    if (!empty($twigmo_requirements_errors)) {
        foreach ($twigmo_requirements_errors as $error) {
            fn_set_notification('W', __('notice'), $error);
        }
        return;
    }
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if ($mode == 'tw_connect') {
        $tw_register = empty($_REQUEST['tw_register']) ? array() : $_REQUEST['tw_register'];
        $connector = new TwigmoConnector();
        $user_data = array('email' => empty($tw_register['email']) ? '' : $tw_register['email'], 'password' => empty($tw_register['password']) ? '' : $tw_register['password'], 'user_id' => $auth['user_id']);
        $stores = empty($tw_register['stores']) ? array() : $tw_register['stores'];
        $is_connected = $connector->connect($stores, $user_data);
        $connector->displayServiceNotifications(true);