コード例 #1
0
 function changefraud()
 {
     $status = $_GET['s'];
     $pid = $_GET['pid'];
     $oRecord = PL::model()->findByPk($pid);
     $oRecord->is_fraud = $status;
     $Panel_id = $oRecord->save();
     $this->getController()->redirect(array("admin/panellist/index"));
 }
コード例 #2
0
 /**
  * Override runWithParams() implementation in CAction to help us parse
  * requests with subactions.
  *
  * @param array $params URL Parameters
  */
 public function runWithParams($params)
 {
     // Default method that would be called if the subaction and run() do not exist
     $sDefault = 'index';
     // Check for a subaction
     if (empty($params['sa'])) {
         $sSubAction = $sDefault;
         // default
     } else {
         $sSubAction = $params['sa'];
     }
     // Check if the class has the method
     $oClass = new ReflectionClass($this);
     if (!$oClass->hasMethod($sSubAction)) {
         // If it doesn't, revert to default Yii method, that is run() which should reroute us somewhere else
         $sSubAction = 'run';
     }
     // Populate the params. eg. plid -> iSurveyId
     $params = $this->_addPseudoParams($params);
     if (!empty($params['iPanellistId'])) {
         if (!PL::model()->findByPk($params['iPanellistId'])) {
             $this->getController()->error('Invalid panel-list id');
         } elseif (!PL::model()->IsValid($params['iPanellistId'])) {
             $this->getController()->error('Not active');
         } else {
         }
     }
     // Check if the method is public and of the action class, not its parents
     // ReflectionClass gets us the methods of the class and parent class
     // If the above method existence check passed, it might not be neceessary that it is of the action class
     $oMethod = new ReflectionMethod($this, $sSubAction);
     // Get the action classes from the admin controller as the urls necessarily do not equal the class names. Eg. survey -> surveyaction
     $aActions = Yii::app()->getController()->getActionClasses();
     if (empty($aActions[$this->getId()]) || strtolower($oMethod->getDeclaringClass()->name) != $aActions[$this->getId()] || !$oMethod->isPublic()) {
         // Either action doesn't exist in our whitelist, or the method class doesn't equal the action class or the method isn't public
         // So let us get the last possible default method, ie. index
         $oMethod = new ReflectionMethod($this, $sDefault);
     }
     // We're all good to go, let's execute it
     // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
     return parent::runWithParamsInternal($this, $oMethod, $params);
 }
コード例 #3
0
     echo CHtml::endForm();
     echo "</div>";
     echo '</td>
                 <td>
                     <a title ="Click change to status Read" href="' . CController::createUrl('admin/message/sa/message_status/s/Unread/id/' . $value['id']) . '">' . $value['status'] . '</a>
                 </td>
             <tr>';
 } else {
     $cls = 'class="even"';
     echo '<tr ' . $cls . '>
                 <td>' . $value['id'] . '</td>
                 <td>';
     if ($value['sender'] == 'P') {
         $user = PL::model()->findAll(array('condition' => 'panel_list_id = ' . $value['email_from'] . ' '));
     } else {
         $user = PL::model()->findAll(array('condition' => 'panel_list_id = ' . $value['email_to'] . ' '));
     }
     echo htmlspecialchars($user[0]['first_name'] . ' ' . $user[0]['last_name']);
     echo '</td>
                 <td>' . $value['subject'] . '</td>
                 <td>&nbsp&nbsp&nbsp' . $value['body'] . '</td>
                 <td>' . $value['created_datetime'] . '</td>
                 <td>';
     echo "<div id='your-form-block-id'>";
     echo CHtml::beginForm();
     echo CHtml::link('Reply', array('admin/message/sa/message_history/id/' . $value['id'] . '/email_to/' . $value['email_from'] . '/subject/' . $value['subject']), array('class' => 'class-link'));
     echo CHtml::endForm();
     echo "</div>";
     echo '</td>
                 <td>
                     <a title ="Click change to status Read" href="' . CController::createUrl('admin/message/sa/message_status/s/Unread/id/' . $value['id']) . '">' . $value['status'] . '</a>
コード例 #4
0
for ($i = 0; $i < count($msglist); $i++) {
    $usr = $msglist[$i];
    if ($usr['status'] == 'Read') {
        ?>
                        <tr>
                            <td><?php 
        echo $usr['id'];
        ?>
</td>
                            <td><?php 
        echo htmlspecialchars($usr['subject']);
        ?>
</td>
                            <td>
                                <?php 
        $user = PL::model()->findAll(array('condition' => 'panel_list_id = ' . $usr['email_from'] . ' '));
        echo htmlspecialchars($user[0]['first_name'] . ' ' . $user[0]['last_name']);
        ?>
                            </td>
                            <td><?php 
        echo htmlspecialchars($usr['body']);
        ?>
</td>
                            <td><?php 
        echo htmlspecialchars($usr['created_datetime']);
        ?>
</td>
                            <td>
                                <?php 
        echo "<div id='your-form-block-id'>";
        echo CHtml::beginForm();
コード例 #5
0
 /**
  * Forgot Password screen
  */
 public function forgotpassword()
 {
     $this->_redirectIfLoggedIn();
     if (!Yii::app()->request->getPost('action')) {
         $this->_renderWrappedTemplate('authentication', 'forgotpassword');
     } else {
         $sEmailAddr = Yii::app()->request->getPost('email');
         $aFields = PL::model()->findAllByAttributes(array('email' => $sEmailAddr));
         if (count($aFields) < 1) {
             // wrong or unknown username and/or email
             $aData['errormsg'] = $this->getController()->lang->gT('Email address not found. Please check the email address you have provided or register for a new account');
             $aData['maxattempts'] = '';
             $this->_renderWrappedTemplate('authentication', 'error', $aData);
         } else {
             $Panellist_id = $aFields[0]['panel_list_id'];
             $activation_id = generate_random(20);
             //$activation_link = Yii::app()->getBaseUrl(true) . '/index.php/pl/registration/sa/activate/c/' . $NewPanellist . '*' . $activation_id;
             $activation_link = Yii::app()->createAbsoluteUrl('pl/registration/sa/activate/c/' . $Panellist_id . '*' . $activation_id);
             $sql_code = "INSERT INTO {{activation_temp}}\n                    (panelllist_id,code,activation_type)\n                    VALUES('{$Panellist_id}','{$activation_id}','forget_pass')";
             $result = Yii::app()->db->createCommand($sql_code)->query();
             $whitelist = array('127.0.0.1', '::1');
             if (!in_array($_SERVER['REMOTE_ADDR'], $whitelist)) {
                 $send = get_SendEmail::model()->SendEmailByTemplate($sEmailAddr, EMAIL_POINT_PL_ForgotPassword, $Panellist_id, array('activation_link' => "{$activation_link}"));
             } else {
                 echo $send = get_SendEmail::model()->SendEmailByTemplate($sEmailAddr, EMAIL_POINT_PL_ForgotPassword, $Panellist_id, array('activation_link' => "{$activation_link}"));
                 exit;
             }
             //$send = get_SendEmail::model()->SendEmailByTemplate($sEmailAddr, EMAIL_POINT_PL_ForgotPassword, $Panellist_id, array('activation_link' => "$activation_link"));
             if (!$send) {
                 $aData['message'] = 'Error in sending mail';
                 echo 'Error';
                 Yii::app()->setFlashMessage($clang->gT("Error in mail send"));
             } else {
                 $aData['message'] = 'A request to reset your password has just been sent to your email address. This email will come from ' . Yii::app()->getConfig("siteadminemail") . '. Simply click on "Link" within that email to complete your password change.
                 Please take this time to add ' . Yii::app()->getConfig("siteadminemail") . ' to your trusted or safe sender list to ensure that our emails are delivered to your Inbox.
                 If you do not receive this email within 15 minutes, please check your junk/spam folder and Contact Us.';
             }
             $this->_renderWrappedTemplate('authentication', 'message', $aData);
         }
     }
 }
コード例 #6
0
<section class="container w45_per" style="margin: 0px auto; min-height: 50px;">
    <div class="box w98_per effect7">
        <h3>Points Detail</h3>
        <p style="display: inline-block">
        <table class="InfoForm" style="width: 95%; margin: 0px auto;">

            <?php 
$sql = PL::model()->findAll(array('condition' => 'panel_list_id = ' . $_SESSION['plid'] . ''));
//print_r($sql);
echo '<tr class = "even"><td><h5>Earn Points = ' . $sql[0]['earn_points'] . '</h5></td></tr>';
echo '<tr class = "even"><td><h5>Balance Points = ' . $sql[0]['balance_points'] . '</h5></td></tr>';
$sql = 'SELECT SUM(points) AS points FROM {{panellist_project}} WHERE status != \'A\' AND status != \'C\' AND panellist_id = ' . $_SESSION['plid'] . ' GROUP BY panellist_id';
$result = Yii::app()->db->createCommand($sql)->queryRow();
if ($result['points'] == '') {
    $point = 0;
} else {
    $point = $result['points'];
}
echo '<tr class = "even"><td><h5>Pending Points = ' . $point . '</h5></td></tr>';
?>
        </table>
        </p>
    </div>
</section>
コード例 #7
0
     $cIsRecv = TRUE;
     $cItalic = "font-style:italic;";
     $cSendRecv = "Recevied";
 } else {
     $cSendRecv = "Sent";
 }
 if ($value['status'] == "Unread") {
     $cUnReadClr = "style='color:orange;text-decoration:none;'";
     $Title = "Click change to status Read";
     $Href = "admin/message/sa/message_status/s/Read/id/" . $value['id'];
 } else {
     $cUnReadClr = "style='color:green;text-decoration:none;'";
     $Title = "Click change to status Unread";
     $Href = "admin/message/sa/message_status/s/Unread/id/" . $value['id'];
 }
 $user = PL::model()->findAll(array("condition" => "email = '" . $value['email_id'] . "' "));
 echo "<tr class='even' style='" . $cItalic . "'>";
 echo "<td>" . $value['id'] . "</td>";
 echo "<td>" . htmlspecialchars($user[0]['first_name'] . ' ' . $user[0]['last_name']) . "</td>";
 echo "<td>" . $value['email_id'] . "</td>";
 echo "<td>" . $value['subject'] . "</td>";
 echo "<td>" . $value['body'] . "</td>";
 echo "<td>" . $value['created_datetime'] . "</td>";
 echo "<td>";
 echo "<div id='your-form-block-id'>";
 echo CHtml::beginForm();
 echo CHtml::link('Reply', array('/pl/home/sa/message_history/id/' . $value['id'] . '/email_to/' . $value['email_from'] . '/subject/' . $value['subject']), array('class' => 'class-link'));
 echo CHtml::endForm();
 echo "</div>";
 echo "</td>";
 echo "<td " . $cUnReadClr . ">";
コード例 #8
0
 function process()
 {
     $aData = array();
     $clang = Yii::app()->lang;
     $aData['Pending'] = false;
     $aData['success'] = false;
     $aData['display'] = true;
     $action = isset($_POST['action']) ? $_POST['action'] : '';
     if ($action == 'resend') {
         $panellist_id = $_POST['panellist_id'];
         $sql = "SELECT * FROM {{activation_temp}} WHERE panelllist_id = '{$panellist_id}' AND activation_type='reg' AND IsActive = '1'";
         $result = Yii::app()->db->createCommand($sql)->query();
         $count = $result->rowCount;
         if ($count > 0) {
             $sresult = $result->readAll();
             $sql = "SELECT * FROM {{panel_list_master}} WHERE panel_list_id = '{$panellist_id}'";
             $result = Yii::app()->db->createCommand($sql)->query()->readAll();
             $email_address = $result[0]['email'];
             $pwd = $result[0]['password'];
             $pwd = base64_decode(urldecode($pwd));
             $activation_id = $sresult[0]['code'];
             //$activation_link = Yii::app()->getBaseUrl(true) . '/index.php/pl/registration/sa/activate/c/' . $panellist_id . '*' . $activation_id;
             $activation_link = Yii::app()->createAbsoluteUrl('pl/registration/sa/activate/c/' . $panellist_id . '*' . $activation_id);
             $whitelist = array('127.0.0.1', '::1');
             if (!in_array($_SERVER['REMOTE_ADDR'], $whitelist)) {
                 $send = get_SendEmail::model()->SendEmailByTemplate($email_address, EMAIL_POINT_PL_RegistrationReSend, $panellist_id, array('pwd' => "{$pwd}", 'activation_link' => "{$activation_link}"));
             } else {
                 echo $send = get_SendEmail::model()->SendEmailByTemplate($email_address, EMAIL_POINT_PL_RegistrationReSend, $panellist_id, array('pwd' => "{$pwd}", 'activation_link' => "{$activation_link}"));
                 exit;
             }
             //$send = get_SendEmail::model()->SendEmailByTemplate($email_address, EMAIL_POINT_PL_RegistrationReSend, $panellist_id, array('pwd' => "$pwd", 'activation_link' => "$activation_link"));
             if (!$send) {
                 echo 'Error';
                 Yii::app()->setFlashMessage($clang->gT("Error in mail send"));
             }
             $this->getController()->redirect(array("pl/registration/sa/process"));
         } else {
             $aData['success'] = true;
         }
     } elseif ($action == 'resetpassword') {
         $panellist_id = $_POST['panellist_id'];
         $new_pass = $_POST['password'];
         $spwd = urlencode(base64_encode($new_pass));
         $oRecord = PL::model()->findByPk($panellist_id);
         $oRecord->password = $spwd;
         $Panel_id = $oRecord->save();
         //            $sql = "SELECT * FROM {{view_panel_list_master}} WHERE panel_list_id = '$panellist_id'";
         //            $sresult = Yii::app()->db->createCommand($sql)->query()->readAll();
         //
         //            Yii::app()->session['plid'] = $sresult[0]['panel_list_id'];
         //            Yii::app()->session['plname'] = $sresult[0]['full_name'];
         //            Yii::app()->session['plemail'] = $sresult[0]['email'];
         //            Yii::app()->session['pluser'] = $sresult[0]['first_name'];
         //            Yii::app()->session['session_hash'] = hash('sha256', getGlobalSetting('SessionName') . $sresult[0]['first_name'] . $sresult[0]['panel_list_id']);
         //$this->_doRedirect();
         $this->_redirectToLoginForm();
     }
     //$aData['display']['header'] = false;
     $this->_renderWrappedTemplate('', 'view_registration', $aData);
 }
コード例 #9
0
$clang->eT("Remote IP");
?>
</th>
            <th width="auto"><?php 
$clang->eT("Status");
?>
</th>
            <th width="auto"><?php 
$clang->eT("Is Fraud ?");
?>
</th>
        </tr>
    </thead>
    <tbody>
        <?php 
$dr = PL::model()->findAll();
for ($i = 0; $i < count($dr); $i++) {
    $row = $dr[$i];
    ?>
            <tr>
                <td style="padding:3px;">
                    <?php 
    $this->widget("application.extensions.Brain.BrainPopupContentWidget", array("popup_box_id" => "box_edit_" . $row['panel_list_id'], "popup_link_id" => "link_edit_" . $row['panel_list_id'], "container_id" => "", "popup_on_load" => "false", "popup_title" => "Edit details of " . $row['first_name'] . ' ' . $row['last_name'], "uid" => $row['panel_list_id'], "height" => "500px;", "width" => "950px;"));
    ?>
                    <a id="link_edit_<?php 
    echo $row['panel_list_id'];
    ?>
"><img src='<?php 
    echo $imageurl;
    ?>
edit_16.png' width="24px;" alt='<?php 
コード例 #10
0
 public function cancel_account()
 {
     App()->getClientScript()->registerPackage('jqgrid');
     $aData['imageurl'] = Yii::app()->getConfig("adminimageurl");
     $action = isset($_POST['action']) ? $_POST['action'] : '';
     if ($action == 'Yes') {
         $pid = $_POST['pid'];
         $oRecord = PL::model()->findByPk($pid);
         $oRecord->status = 'C';
         $Panel_id = $oRecord->save();
         $this->getController()->redirect(array('/pl/authentication/sa/logout'));
     }
     $this->_renderWrappedTemplate('', 'cancel_account', $aData);
 }