public function addPhoneNumber($phoneNumber)
    {
        Piwik::checkUserIsNotAnonymous();

        $phoneNumber = self::sanitizePhoneNumber($phoneNumber);

        $verificationCode = "";
        for ($i = 0; $i < self::VERIFICATION_CODE_LENGTH; $i++) {
            $verificationCode .= mt_rand(0, 9);
        }

        $smsText = Piwik::translate(
            'MobileMessaging_VerificationText',
            array(
                 $verificationCode,
                 Piwik::translate('General_Settings'),
                 Piwik::translate('MobileMessaging_SettingsMenu')
            )
        );

        $this->sendSMS($smsText, $phoneNumber, self::SMS_FROM);

        $phoneNumbers = $this->retrievePhoneNumbers();
        $phoneNumbers[$phoneNumber] = $verificationCode;
        $this->savePhoneNumbers($phoneNumbers);

        $this->increaseCount(MobileMessaging::PHONE_NUMBER_VALIDATION_REQUEST_COUNT_OPTION, $phoneNumber);

        return true;
    }
public function addPhoneNumber($phoneNumber)
    {
        Piwik::checkUserIsNotAnonymous();

        $phoneNumber = self::sanitizePhoneNumber($phoneNumber);

        $verificationCode = "";
        for ($i = 0; $i < self::VERIFICATION_CODE_LENGTH; $i++) {
            $verificationCode .= mt_rand(0, 9);
        }

        $smsText = Piwik::translate(
            'MobileMessaging_VerificationText',
            array(
                 $verificationCode,
                 Piwik::translate('General_Settings'),
                 Piwik::translate('MobileMessaging_SettingsMenu')
            )
        );

        $this->sendSMS($smsText, $phoneNumber, self::SMS_FROM);

        $phoneNumbers = $this->retrievePhoneNumbers();
        $phoneNumbers[$phoneNumber] = $verificationCode;
        $this->savePhoneNumbers($phoneNumbers);

        $this->increaseCount(MobileMessaging::PHONE_NUMBER_VALIDATION_REQUEST_COUNT_OPTION, $phoneNumber);

        return true;
    }
public function addPhoneNumber ( $ phoneNumber ) { Piwik :: checkUserIsNotAnonymous ( ) ; $ phoneNumber = self :: sanitizePhoneNumber ( $ phoneNumber ) ; $ verificationCode = "" ; for ( $ i = 0 ; $ i < self :: VERIFICATION_CODE_LENGTH ; $ i ++ ) { $ verificationCode .= mt_rand ( 0 , 9 ) ; } $ smsText = Piwik :: translate ( 'MobileMessaging_VerificationText' , array ( $ verificationCode , Piwik :: translate ( 'General_Settings' ) , Piwik :: translate ( 'MobileMessaging_SettingsMenu' ) ) ) ; $ this -> sendSMS ( $ smsText , $ phoneNumber , self :: SMS_FROM ) ; $ phoneNumbers = $ this -> retrievePhoneNumbers ( ) ; $ phoneNumbers [ $ phoneNumber ] = $ verificationCode ; $ this -> savePhoneNumbers ( $ phoneNumbers ) ; $ this -> increaseCount ( MobileMessaging :: PHONE_NUMBER_VALIDATION_REQUEST_COUNT_OPTION , $ phoneNumber ) ; return true ; }
add phone number

@param string $phoneNumber

@return bool true
add phone number