當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Kronolith::removeUserEvents方法代碼示例

本文整理匯總了PHP中Kronolith::removeUserEvents方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kronolith::removeUserEvents方法的具體用法?PHP Kronolith::removeUserEvents怎麽用?PHP Kronolith::removeUserEvents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Kronolith的用法示例。


在下文中一共展示了Kronolith::removeUserEvents方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: removeUserData

 /**
  */
 public function removeUserData($user)
 {
     $error = false;
     // Remove all events owned by the user in all calendars.
     Kronolith::removeUserEvents($user);
     // Get the shares owned by the user being deleted.
     try {
         $kronolith_shares = $GLOBALS['injector']->getInstance('Kronolith_Shares');
         $shares = $kronolith_shares->listShares($user, array('attributes' => $user));
         foreach ($shares as $share) {
             $kronolith_shares->removeShare($share);
         }
     } catch (Exception $e) {
         Horde::log($e, 'NOTICE');
         $error = true;
     }
     /* Get a list of all shares this user has perms to and remove the
      * perms */
     try {
         $shares = $kronolith_shares->listShares($user);
         foreach ($shares as $share) {
             $share->removeUser($user);
         }
     } catch (Horde_Share_Exception $e) {
         Horde::log($e, 'NOTICE');
         $error = true;
     }
     if ($error) {
         throw new Kronolith_Exception(sprintf(_("There was an error removing calendars for %s. Details have been logged."), $user));
     }
 }
開發者ID:horde,項目名稱:horde,代碼行數:33,代碼來源:Application.php


注:本文中的Kronolith::removeUserEvents方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。