Beispiel #1
0
 public function signup($aData)
 {
     $row = $this->save($aData);
     //Must also assign assign user as group:member_free
     $acl = new Kutu_Acl_Adapter_Local();
     $acl->addUserToGroup($row->username, "member_gratis");
     if ($row->packageId == 27) {
     } elseif ($row->packageId == 26) {
     } else {
         $mailcontent = $this->getMailContent('konfirmasi email gratis');
         $this->_writeConfirmFreeEmail($mailcontent, $row->fullName, $row->username, $aData['password'], $row->guid, $row->email, 'gratis');
     }
 }
Beispiel #2
0
 function signupAction()
 {
     $this->_helper->layout->setLayout('layout-newhukumonlineid-daftar');
     $this->view->identity = 'Daftar';
     $r = $this->getRequest();
     if ($r->isPost()) {
         $fullName = $r->getParam('fullname');
         $username = $r->getParam('username');
         $password = $r->getParam('password');
         $email = $r->getParam('email');
         $package = $r->getParam('aro_groups');
         $kopel = $this->generateKopel();
         $obj = new Kutu_Crypt_Password();
         $data = array('kopel' => $kopel, 'username' => $username, 'password' => $obj->encryptPassword($password), 'fullName' => $fullName, 'email' => $email, 'packageId' => $package, 'periodeId' => 1, 'createdDate' => date('Y-m-d H:i:s'), 'createdBy' => $username);
         $modelUser = new Kutu_Core_Orm_Table_User();
         $modelUser->insert($data);
         $this->updateKopel();
         $acl = new Kutu_Acl_Adapter_Local();
         //$acl->addUser($username,"Free");
         $acl->addUserToGroup($username, "Free");
         $formater = new Kutu_Core_Hol_User();
         $mailcontent = $formater->getMailContent('konfirmasi email gratis');
         $m = $formater->_writeConfirmFreeEmail($mailcontent, $fullName, $username, $password, base64_encode($kopel), $email, 'gratis');
         $this->view->message = $m;
     }
     $tblCatalog = new Kutu_Core_Orm_Table_Catalog();
     $rowset = $tblCatalog->fetchRow("shortTitle='halaman-depan-login' AND status=99");
     if (!empty($rowset)) {
         $rowsetCatalogAttribute = $rowset->findDependentRowsetCatalogAttribute();
         $fixedContent = $rowsetCatalogAttribute->findByAttributeGuid('fixedContent')->value;
     } else {
         $fixedContent = '';
     }
     $this->view->content = $fixedContent;
 }
Beispiel #3
0
 protected function _postDelete()
 {
     $tblUserDetail = new Kutu_Core_Orm_Table_UserDetail();
     $rowsetUserDetail = $tblUserDetail->fetchAll("uid='{$this->guid}'");
     foreach ($rowsetUserDetail as $row) {
         // delete
         $row->delete();
     }
     //delete from table KutuUserInvoice
     $tblInvoice = new Kutu_Core_Orm_Table_Invoice();
     $tblInvoice->delete("uid='{$this->kopel}'");
     //delete from table KutuUserAccessLog
     $tblUserLog = new Kutu_Core_Orm_Table_UserLog();
     $tblUserLog->delete("user_id='{$this->guid}'");
     //delete from ACL
     $aclMan = new Kutu_Acl_Adapter_Local();
     $aclMan->deleteUser($this->username);
     // delete physical user folder define by guid
     $sDir = KUTU_ROOT_DIR . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . $this->guid;
     try {
         $this->removeRessource($sDir);
     } catch (Exception $e) {
         throw new Exception($e);
     }
 }
Beispiel #4
0
 /**
  * writeCalendar
  * @param $month, $year
  * @return $string
  */
 function writeCalendar($month, $year)
 {
     $str = $this->getDayNameHeader();
     $eventdata = $this->getEventDataArray($month, $year);
     //print_r($eventdata);
     // get week position of first day of month
     $weekpos = $this->getFirstDayOfMonthPosition($month, $year);
     // get number of days in month
     $days = 31 - (($month - ($month < 8 ? 1 : 0)) % 2 + ($month == 2 ? !($year % (!($year % 100) ? 400 : 4)) ? 1 : 2 : 0));
     // initialize day variable to zero, unless $weekpos is zero
     if ($weekpos == 0) {
         $day = 1;
     } else {
         $day = 0;
     }
     // initialize today's date variables for color change
     $timestamp = time() + CURR_TIME_OFFSET * 3600;
     $d = date("d", $timestamp);
     $m = date("n", $timestamp);
     $y = date("Y", $timestamp);
     // loop writes empty cells until it reaches position of 1st day of month ($wPos)
     // it writes the days, then fills the last row with empty cells after last day
     // get group information
     $acl = new Kutu_Acl_Adapter_Local();
     $aReturn = isset(Zend_Auth::getInstance()->getIdentity()->username) ? $acl->getUserGroupIds(Zend_Auth::getInstance()->getIdentity()->username) : '';
     while ($day <= $days) {
         $str .= "<tr>\n";
         for ($i = 0; $i < 7; $i++) {
             if ($day > 0 && $day <= $days) {
                 $str .= "\t<td class=\"";
                 if ($day == $d && $month == $m && $year == $y) {
                     $str .= "today";
                 } else {
                     $str .= "day";
                 }
                 $str .= "_cell\" valign=\"top\"><span class=\"day_number\">";
                 if (isset($aReturn[1]) == "administrator") {
                     $str .= "<a href=\"javascript: openActionDialog('postMessage', '', {$day}, {$month}, {$year})\">{$day}</a>";
                 } else {
                     $str .= "{$day}";
                 }
                 $str .= "</span><br>";
                 // enforce title limit
                 if (array_key_exists($day, $eventdata)) {
                     $eventcount = count($eventdata[$day]['title']);
                     if (MAX_TITLES_DISPLAYED < $eventcount) {
                         $eventcount = MAX_TITLES_DISPLAYED;
                     }
                     // write title link if posting exists for day
                     for ($j = 0; $j < $eventcount; $j++) {
                         $str .= "<span class=\"title_txt\">-";
                         $str .= "<a href=\"javascript:openActionDialog('openPosting'," . $eventdata[$day]["id"][$j] . ")\">";
                         $str .= $eventdata[$day]["title"][$j] . "</a></span>" . $eventdata[$day]["timestr"][$j];
                     }
                 }
                 $str .= "</td>\n";
                 $day++;
             } elseif ($day == 0) {
                 $str .= "\t<td class=\"empty_day_cell\" valign=\"top\">&nbsp;</td>\n";
                 $weekpos--;
                 if ($weekpos == 0) {
                     $day++;
                 }
             } else {
                 $str .= "\t<td class=\"empty_day_cell\" valign=\"top\">&nbsp;</td>\n";
             }
         }
         $str .= "</tr>\n\n";
     }
     $str .= "</table>\n\n";
     return $str;
 }
Beispiel #5
0
 function transformMigrationUser($value)
 {
     if ($value["birthday"] == "1970-01-01" || $value["birthday"] == "") {
         $birthday = "0000-00-00";
     } else {
         $birthday = $value["birthday"];
     }
     $groupName = $this->getGroupName($_POST['packageId']);
     $acl = new Kutu_Acl_Adapter_Local();
     $groupId = $acl->getGroupIds($groupName);
     $data = array('kopel' => $this->generateKopel(), 'username' => $value['username'], 'password' => $value['password'], 'fullName' => $value['fullName'] ? $value['fullName'] : '', 'birthday' => $birthday, 'phone' => $value['phone'] ? $value['phone'] : '', 'fax' => $value['fax'] ? $value['fax'] : '', 'gender' => $value['gender'], 'email' => $value['email'], 'company' => $value['company'] ? $value['company'] : '', 'address' => $value['address'] ? $value['address'] : '', 'state' => 7, 'countryId' => 'ID', 'newArticle' => $value['newArticle'], 'weeklyList' => $value['weeklyList'], 'monthlyList' => $value['monthlyList'], 'packageId' => $groupId, 'promotionId' => $value['promotionId'], 'educationId' => $value['educationId'], 'expenseId' => $value['expenseId'], 'paymentId' => $value['paymentId'], 'businessTypeId' => $value['businessTypeId'], 'periodeId' => $value['periodeId'], 'activationDate' => $value['activationDate'], 'isEmailSent' => $value['isEmailSent'], 'isEmailSentOver' => $value['isEmailSentOver'], 'createdDate' => $value['createdDate'], 'createdBy' => $value['createdBy'], 'modifiedDate' => $value['updatedDate'] ? $value['updatedDate'] : '', 'modifiedBy' => $value['updatedBy'] ? $value['updatedBy'] : '', 'isActive' => $value['isActive'], 'isContact' => $value['isContact']);
     return $data;
 }