/** * This method is commonly used for promotions or sweepstakes: if a * user wants to participate in a promotion, the web client must * ensure that the user is logged and have all the fields filled * in order to let him participate. * * - If it is not logged, will return the login URL. * - If it is logged the method will check * - If the user have not enough PII to access to a section, * returns the URL needed to force a consumer to fill all the * PII needed to enter into a section * - Else will return false (user logged and completed) * * The "scope" (section) is a group of fields configured in Genetsis ID for * a web client. * * A section can be also defined as a "part" (section) of the website * (web client) that only can be accesed by a user who have filled a * set of personal information configured in Genetsis ID (all of the fields * required for that section). * * @param string Section-key Identifier of the web client. The * section-key is located in "oauthconf.xml" file. * @return string With generated URL. If the user is not connected, * will return login URL. * @throws Exception if scope is empty. */ public static function buildSignupPromotionUrl($scope) { try { if (self::checkParam($scope)) { throw new \Exception('Scope section is empty'); } if (!Identity::isConnected()) { return sefl::getUrlLogin($scope); } else { if (!Identity::checkUserComplete($scope)) { return self::getUrlCompleteAccount($scope); } } return false; } catch (\Exception $e) { Identity::getLogger()->debug('Error [' . __FUNCTION__ . '] - ' . $e->getMessage()); } }
/** * Instead $GLOBALS['wp_filesystem']->get_contents( $file ) * * @param type $url host url. * @return string requres data */ public static function get_contents($url) { $wp_filesystem = sefl::get_wp_filesystem(); $wp_filesystem->get_contents($url); return $data; }