Ejemplo n.º 1
0
 public function actionIndex()
 {
     $uid = $this->uid;
     $total = 0;
     $folders = $this->folders;
     foreach ($folders as &$folder) {
         $size = EmailFolder::model()->getFolderSize($uid, $folder["fid"]);
         $folder["size"] = ConvertUtil::sizeCount($size);
         $total += $size;
     }
     $inbox = EmailFolder::model()->getSysFolderSize($uid, "inbox");
     $web = EmailFolder::model()->getSysFolderSize($uid, "web");
     $sent = EmailFolder::model()->getSysFolderSize($uid, "send");
     $deleted = EmailFolder::model()->getSysFolderSize($uid, "del");
     $userSize = EmailUtil::getUserSize($uid);
     $data = array("folders" => $folders, "inbox" => ConvertUtil::sizeCount($inbox), "web" => ConvertUtil::sizeCount($web), "sent" => ConvertUtil::sizeCount($sent), "deleted" => ConvertUtil::sizeCount($deleted), "userSize" => $userSize, "total" => ConvertUtil::sizeCount(array_sum(array($total, $inbox, $web, $sent, $deleted))));
     $this->setPageTitle(Ibos::lang("Folder setting"));
     $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Personal Office")), array("name" => Ibos::lang("Email center"), "url" => $this->createUrl("list/index")), array("name" => Ibos::lang("Folder setting"))));
     $this->render("index", $data);
 }
Ejemplo n.º 2
0
 protected function checkUserSize()
 {
     $userSize = EmailUtil::getUserSize($this->uid);
     $usedSize = EmailFolder::model()->getUsedSize($this->uid);
     if (ConvertUtil::ConvertBytes($userSize . "m") < $usedSize) {
         $this->error(Ibos::lang("Capacity overflow", "", array("{size}" => $usedSize)), $this->createUrl("email/list"));
     }
 }