Пример #1
0
/**
 * send confirmation reminder
 * @param integer $fromUserId
 * @param integer $toUserId
 * @param integer $range 
 * @param string $condition
 */
function sendReminder($fromUserId, $toUserId, $range, $condition)
{
    global $wgCityId, $wgServer;
    wfProfileIn(__METHOD__);
    $condition .= " and user_wiki_id = " . $wgCityId;
    // get scope
    if (empty($fromUserId) || empty($toUserId)) {
        getScope($fromUserId, $toUserId, $condition);
    }
    // update url
    $wgServer = WikiFactory::getVarValueByName('wgServer', $wgCityId);
    $cnt = 0;
    do {
        $to = $toUserId - $fromUserId > $range ? $fromUserId + $range : $toUserId;
        echo "WikiId {$wgCityId}: Sending reminder (UserId {$fromUserId} to {$to})...\n";
        $users = getTempUsers($fromUserId, $to, $condition);
        foreach ($users as $username) {
            $tempUser = TempUser::getTempUserFromName($username);
            // send reminder email
            $user = $tempUser->mapTempUserToUser();
            $userLoginHelper = F::build('UserLoginHelper');
            $result = $userLoginHelper->sendConfirmationReminderEmail($user);
            if (!$result->isGood()) {
                echo "Error: Cannot Send reminder to temp user (id=" . $tempUser->getId() . ", email=" . $tempUser->getEmail() . "): " . $result->getMessage() . "\n";
            } else {
                $tempUser->saveSettingsTempUserToUser($user);
                $cnt++;
                echo "Sent reminder to temp user (id=" . $tempUser->getId() . ", email=" . $tempUser->getEmail() . ").\n";
            }
        }
        $fromUserId = $to;
    } while ($fromUserId < $toUserId);
    echo "WikiId {$wgCityId}: Total {$cnt} confirmation reminder emails sent.\n";
    wfProfileOut(__METHOD__);
}
 *  All Rights Reserved.
 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$scope = getScope();
if ($scope == "web") {
    if (loggedIn()) {
        $video_albums = listEntities(array("type" => "Videoalbum", "metadata_name" => "owner_guid", "metadata_value" => getLoggedInUserGuid(), "view_type" => "videopicker_gallery"));
        ?>
        <div class="modal fade" id="insert_video_modal" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-body clearfix">
                        <h3>Select an album/video.</h3>
                        <?php 
        echo $video_albums;
        ?>
                        <div id="videos" class="clearfix"></div>
                        <h3>-or-</h3>
                        <?php