示例#1
0
 /**
  * Resend the confirmation mail in case the user clicked on the link in the
  * login error message
  *
  * @param string $username
  */
 public function resendConfirmationMail($username)
 {
     // fetch ID for member $username
     $vars = array();
     $MembersModel = new MembersModel();
     $member = $MembersModel->getMemberWithUsername($username);
     if ($member) {
         if ($member->Status == 'MailToConfirm') {
             $vars['firstname'] = MOD_crypt::AdminReadCrypted($member->Firstname);
             $vars['secondname'] = MOD_crypt::AdminReadCrypted($member->Secondname);
             $vars['lastname'] = MOD_crypt::AdminReadCrypted($member->Lastname);
             $vars['email'] = MOD_crypt::AdminReadCrypted($member->Email);
             $userId = APP_User::userId($username);
             if (!$userId) {
                 return 'NoSuchMember';
             } else {
                 $View = new SignupView($this);
                 define('DOMAIN_MESSAGE_ID', 'bewelcome.org');
                 // TODO: config
                 $View->registerMail($vars, $member->id, $userId);
             }
         } else {
             return 'NoMailToConfirm';
         }
     } else {
         return 'NoSuchMember';
     }
     return true;
 }
示例#2
0
BW Rox is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
BW Rox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/> or
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA  02111-1307, USA.
*/
$words = new MOD_words();
$model = new MembersModel();
$member = $model->getMemberWithUsername($receiver_username);
?>
<div id="message" class="floatbox">
    <div id="shade_top"></div>
    <div id="messageheader" class="floatbox">
        <div id="messageside" class="float_right">
      <p class="small grey">
        <?php 
echo $words->get('LivesIn');
?>
 <strong><?php 
echo $member->City;
?>
, <?php 
echo $member->Country;
?>
示例#3
0
 protected function getMember($cid)
 {
     $model = new MembersModel();
     if (is_numeric($cid)) {
         return $model->getMemberWithId($cid);
     } else {
         if (!empty($cid)) {
             return $model->getMemberWithUsername($cid);
         } else {
             return false;
         }
     }
 }
示例#4
0
    protected function column_col3()
    {
        $words = new MOD_words();
        $message = $this->message;
        $purifier = new MOD_htmlpure();
        $purifier = $purifier->getMessagesHtmlPurifier();
        $contact_username = $message->senderUsername;
        $model = new MembersModel();
        $direction_in = true;
        if ($contact_username == $_SESSION['Username']) {
            $contact_username = $message->receiverUsername;
            $direction_in = false;
        }
        $member = $model->getMemberWithUsername($contact_username);
        ?>
        <div id="message" class="floatbox">
            <div id="shade_top"></div>
            <div id="buttonstop">
                <p class="floatbox">
                    <?php 
        if ($direction_in) {
            ?>
                        <a class="button float_left"
                           href="messages/<?php 
            echo $message->id;
            ?>
/reply"><?php 
            echo $words->get('replymessage');
            ?>
</a>
                        <?php 
            if ($message->InFolder == 'Spam') {
                ?>
                            <a class="button float_right"
                               href="messages/<?php 
                echo $message->id;
                ?>
/nospam"><?php 
                echo $words->get('marknospam');
                ?>
</a>
                        <?php 
            } else {
                ?>
                            <a class="button float_right"
                               href="messages/<?php 
                echo $message->id;
                ?>
/spam"><?php 
                echo $words->get('markspam');
                ?>
</a>
                        <?php 
            }
            ?>
                    <?php 
        } else {
            ?>
                        <a class="button float_left"
                           href="messages/<?php 
            echo $message->id;
            ?>
/edit"><?php 
            echo $words->get('editmessage');
            ?>
</a>
                    <?php 
        }
        ?>
                    <a class="button float_right" href="messages/<?php 
        echo $message->id;
        ?>
/delete"
                       onclick="return confirm ('<?php 
        echo $words->getBuffered('MessagesWarningConfirmDelete');
        ?>
')"><?php 
        echo $words->get('delmessage');
        ?>
</a>
                    <?php 
        echo $words->flushBuffer();
        ?>
                </p>
            </div>
            <!-- buttonstop -->
            <div id="messageheader" class="floatbox">
                <div id="messageside" class="float_right">
                    <p class="small grey">
                        <?php 
        echo $words->get('LivesIn');
        ?>
 <strong><?php 
        echo $member->City;
        ?>
, <?php 
        echo $member->Country;
        ?>
</strong>
                        <br/>
                        <?php 
        echo $words->get('Speaks');
        ?>
                        <?php 
        $languages = $member->get_languages_spoken();
        if (count($languages) > 0) {
            $ii = 0;
            $max = count($languages);
            foreach ($languages as $language) {
                $space = $ii != $max - 1 ? ', ' : '';
                ?>
<strong><span
                                    title="<?php 
                echo $words->getSilent('LanguageLevel_' . $language->Level);
                ?>
"><?php 
                echo $language->Name;
                echo $space;
                ?>
</span>
                                </strong><?php 
                echo $words->flushBuffer();
                $ii++;
            }
        }
        ?>
                    </p>

                    <p class="small grey">
                        <a href="messages/with/<?php 
        echo $contact_username;
        ?>
"><img src="images/icons/comments.png"
                                                                              alt="<?php 
        echo $words->getSilent('messages_allmessageswith', $contact_username);
        ?>
"
                                                                              title="<?php 
        echo $words->getSilent('messages_allmessageswith', $contact_username);
        ?>
"/> <?php 
        echo $words->getSilent('messages_allmessageswith', $contact_username);
        ?>
                        </a>
                    </p>
                </div>
                <!-- messageside -->
                <p class="float_left">
                    <?php 
        echo MOD_layoutbits::PIC_50_50($contact_username);
        ?>
                </p>

                <p class="">
                    <span
                        class="grey"><?php 
        echo $direction_in ? $words->get('MessageFrom', '<a href="members/' . $contact_username . '">' . $contact_username . '</a>') : $words->get('MessageTo', '<a href="members/' . $contact_username . '">' . $contact_username . '</a>');
        ?>
 </span>
                </p>

                <p class="">
                    <span class="grey"><?php 
        echo $words->get('MessagesDate');
        ?>
                        : </span> <?php 
        echo date($words->getSilent('DateFormatShort'), strtotime($message->created));
        ?>
                </p>
            </div>
            <div id="messagecontent">
                <p class="text">
                    <?php 
        echo $purifier->purify($message->Message);
        ?>
                </p>
            </div>
            <!-- messagecontent -->
            <div id="messagefooter">
                <p class="floatbox">
                    <?php 
        if ($direction_in) {
            ?>
                        <a class="button float_left"
                           href="messages/<?php 
            echo $message->id;
            ?>
/reply"><?php 
            echo $words->get('replymessage');
            ?>
</a>
                        <?php 
            if ($message->InFolder == 'Spam') {
                ?>
                            <a class="button float_right"
                               href="messages/<?php 
                echo $message->id;
                ?>
/nospam"><?php 
                echo $words->get('marknospam');
                ?>
</a>
                        <?php 
            } else {
                ?>
                            <a class="button float_right"
                               href="messages/<?php 
                echo $message->id;
                ?>
/spam"><?php 
                echo $words->get('markspam');
                ?>
</a>
                        <?php 
            }
            ?>
                    <?php 
        } else {
            ?>
                        <a class="button float_left"
                           href="messages/<?php 
            echo $message->id;
            ?>
/edit"><?php 
            echo $words->get('editmessage');
            ?>
</a>
                    <?php 
        }
        ?>
                    <a class="button float_right"
                       href="messages/<?php 
        echo $message->id;
        ?>
/delete"><?php 
        echo $words->get('delmessage');
        ?>
</a>
                </p>
            </div>
            <!-- messagefooter -->
            <div id="shade"></div>
        </div> <!-- message -->
        <?php 
        echo $words->flushBuffer();
        ?>

    <?php 
    }
示例#5
0
 /**
  * Checks if an image is publicly visible.
  *
  * Note: Currently this only checks if the image owner's profile is public.
  * If individual image or album rights are implemented, they can be checked
  * here.
  *
  * @param object $image Image as returned by GalleryModel::imageData()
  *
  * @return bool True if publicly visible, false if not
  */
 private function imageIsPublic($image)
 {
     if (isset($this->membersmodel)) {
         $members = $this->membersmodel;
     } else {
         $members = new MembersModel();
     }
     $imageOwner = $members->getMemberWithUsername($image->user_handle);
     if ($imageOwner->publicProfile === false) {
         return false;
     } else {
         return true;
     }
 }