当前位置: 首页>>代码示例>>PHP>>正文


PHP Config::setUserValue方法代码示例

本文整理汇总了PHP中OCP\Config::setUserValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::setUserValue方法的具体用法?PHP Config::setUserValue怎么用?PHP Config::setUserValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OCP\Config的用法示例。


在下文中一共展示了Config::setUserValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: set

 /**
  * @NoAdminRequired
  */
 public function set()
 {
     \OCP\Config::setUserValue($this->api->getUserId(), 'tasks_enhanced', $this->params('type') . '_' . $this->params('setting'), $this->params('value'));
     $response = new JSONResponse();
     $response->setData();
     return $response;
 }
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:10,代码来源:settingscontroller.php

示例2: updateEmail

 private function updateEmail($dn)
 {
     $email = null;
     $emailAttribute = $this->connection->ldapEmailAttribute;
     if (!empty($emailAttribute)) {
         $aEmail = $this->readAttribute($dn, $emailAttribute);
         if ($aEmail && count($aEmail) > 0) {
             $email = $aEmail[0];
         }
         if (!is_null($email)) {
             \OCP\Config::setUserValue($this->dn2username($dn), 'settings', 'email', $email);
         }
     }
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:14,代码来源:user_ldap.php

示例3: set

 /**
  * @NoAdminRequired
  */
 public function set()
 {
     $request = $this->request;
     //$request = json_decode(file_get_contents('php://input'), true);
     $key = $request->post['key'];
     $value = $request->post['value'];
     $response = new JSONResponse();
     if (is_null($key) || $key === "") {
         $response->bailOut(App::$l10n->t('No key is given.'));
     }
     if (is_null($value) || $value === "") {
         $response->bailOut(App::$l10n->t('No value is given.'));
     }
     if (\OCP\Config::setUserValue(\OCP\User::getUser(), 'contacts', $key, $value)) {
         $response->setParams(array('key' => $key, 'value' => $value));
         return $response;
     } else {
         $response->bailOut(App::$l10n->t('Could not set preference: ' . $key . ':' . $value));
     }
 }
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:23,代码来源:settingscontroller.php

示例4: update_quota

 private static function update_quota($uid, $quota)
 {
     if (!empty($quota)) {
         \OCP\Config::setUserValue($uid, 'files', 'quota', \OCP\Util::computerFileSize($quota));
     }
 }
开发者ID:AARNet,项目名称:user_saml,代码行数:6,代码来源:hooks.php

示例5: Dispatcher

    \OC::$session->close();
    $dispatcher = new Dispatcher($params);
    $dispatcher->dispatch('GroupController', 'deleteGroup');
});
$this->create('contacts_categories_rename', 'groups/rename')->post()->action(function ($params) {
    \OC::$session->close();
    $dispatcher = new Dispatcher($params);
    $dispatcher->dispatch('GroupController', 'renameGroup');
});
$this->create('contacts_categories_addto', 'groups/addto/{categoryId}')->post()->action(function ($params) {
    \OC::$session->close();
    $dispatcher = new Dispatcher($params);
    $dispatcher->dispatch('GroupController', 'addToGroup');
});
$this->create('contacts_categories_removefrom', 'groups/removefrom/{categoryId}')->post()->action(function ($params) {
    \OC::$session->close();
    $dispatcher = new Dispatcher($params);
    $dispatcher->dispatch('GroupController', 'removeFromGroup');
})->requirements(array('categoryId'));
$this->create('contacts_setpreference', 'preference/set')->post()->action(function ($params) {
    \OC::$session->close();
    $dispatcher = new Dispatcher($params);
    $dispatcher->dispatch('SettingsController', 'set');
});
$this->create('contacts_index_properties', 'indexproperties/{user}/')->post()->action(function ($params) {
    \OC::$session->close();
    // TODO: Add BackgroundJob for this.
    \OCP\Util::emitHook('OCA\\Contacts', 'indexProperties', array());
    \OCP\Config::setUserValue($params['user'], 'contacts', 'contacts_properties_indexed', 'yes');
    \OCP\JSON::success(array('isIndexed' => true));
})->requirements(array('user'))->defaults(array('user' => \OCP\User::getUser()));
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:31,代码来源:routes.php

示例6: setAddressbookList

 /**
  * @brief sets the list of ldap addressbooks in the preferences
  * with the list given in parameter
  * @param the new list
  * @returns result|false
  */
 protected function setAddressbookList(array $addressbookList)
 {
     $key = $this->name . "_list";
     $data = json_encode($addressbookList);
     return $data ? \OCP\Config::setUserValue($this->userid, 'contacts', $key, $data) : false;
 }
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:12,代码来源:ldap.php

示例7: disablefirstrun

 /**
  * @NoAdminRequired
  */
 public function disablefirstrun()
 {
     \OCP\Config::setUserValue(\OCP\User::getUser(), 'firstpassmanrun', 'show', 0);
     echo "Succes!";
 }
开发者ID:viki53,项目名称:passman,代码行数:8,代码来源:pagecontroller.php

示例8: setUserValue

	/**
	 * Set a user defined value
	 *
	 * @param string $userId the userId of the user that we want to store the value under
	 * @param string $appName the appName that we want to store the value under
	 * @param string $key the key under which the value is being stored
	 * @param string $value the value that you want to store
	 */
	public function setUserValue($userId, $appName, $key, $value) {
		\OCP\Config::setUserValue($userId, $appName, $key, $value);
	}
开发者ID:ArcherSys,项目名称:ArcherSysOSCloud7,代码行数:11,代码来源:allconfig.php

示例9: while

* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*
*/
\OCP\JSON::checkLoggedIn();
\OCP\JSON::checkAppEnabled('activity');
\OCP\JSON::callCheck();
$l = \OCP\Util::getL10N('activity');
$token = $tokenUrl = '';
if ($_POST['enable'] === 'true') {
    // Check for collisions
    $token = \OCP\Util::generateRandomBytes();
    $preferences = new \OC\Preferences(\OC_DB::getConnection());
    $conflicts = $preferences->getUsersForValue('activity', 'rsstoken', $token);
    while (!empty($conflicts)) {
        $token = \OCP\Util::generateRandomBytes();
        $conflicts = $preferences->getUsersForValue('activity', 'rsstoken', $token);
    }
    $tokenUrl = \OC::$server->getURLGenerator()->getAbsoluteURL(\OC::$server->getURLGenerator()->linkToRoute('activity.rss', array('token' => $token)));
}
\OCP\Config::setUserValue(\OCP\User::getUser(), 'activity', 'rsstoken', $token);
\OCP\JSON::success(array('data' => array('message' => $l->t('Your settings have been updated.'), 'rsslink' => $tokenUrl)));
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:31,代码来源:rssfeed.php

示例10: isset

<?php

/**
 * ownCloud - Documents App
 *
 * @author Victor Dubiniuk
 * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 */
namespace OCA\Documents;

\OCP\JSON::callCheck();
\OCP\JSON::checkLoggedIn();
$l = \OC_L10N::get('documents');
$savePath = isset($_POST['savePath']) ? $_POST['savePath'] : null;
if (!is_null($savePath)) {
    if (\OC\Files\Filesystem::file_exists($savePath) === false) {
        if (!\OC\Files\Filesystem::mkdir($savePath)) {
            \OCP\JSON::error(array('data' => array('message' => $l->t('An error occurred while changing directory.'))));
        }
    }
    \OCP\Config::setUserValue(\OCP\User::getUser(), 'documents', 'save_path', $savePath);
    \OCP\JSON::success(array('data' => array('message' => $l->t('Directory saved successfully.'))));
    exit;
}
exit;
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:28,代码来源:personal.php

示例11: array

*
* This library 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 AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*
*/
\OCP\JSON::checkLoggedIn();
\OCP\JSON::checkAppEnabled('activity');
\OCP\JSON::callCheck();
$notify_email = $notify_stream = array();
$l = \OCP\Util::getL10N('activity');
$data = new \OCA\Activity\Data(\OC::$server->getActivityManager());
$types = $data->getNotificationTypes($l);
foreach ($types as $type => $desc) {
    \OCP\Config::setUserValue(\OCP\User::getUser(), 'activity', 'notify_email_' . $type, !empty($_POST[$type . '_email']));
    \OCP\Config::setUserValue(\OCP\User::getUser(), 'activity', 'notify_stream_' . $type, !empty($_POST[$type . '_stream']));
}
$email_batch_time = 3600;
if ($_POST['notify_setting_batchtime'] == \OCA\Activity\UserSettings::EMAIL_SEND_DAILY) {
    $email_batch_time = 3600 * 24;
}
if ($_POST['notify_setting_batchtime'] == \OCA\Activity\UserSettings::EMAIL_SEND_WEEKLY) {
    $email_batch_time = 3600 * 24 * 7;
}
\OCP\Config::setUserValue(\OCP\User::getUser(), 'activity', 'notify_setting_batchtime', $email_batch_time);
\OCP\Config::setUserValue(\OCP\User::getUser(), 'activity', 'notify_setting_self', !empty($_POST['notify_setting_self']));
\OCP\JSON::success(array("data" => array("message" => $l->t('Your settings have been updated.'))));
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:31,代码来源:settings.php

示例12: put

 /**
  * store meta data for a file or folder
  *
  * @param string $file
  * @param array $data
  *
  * @return int file id
  */
 public function put($file, array $data)
 {
     if ($file === '' && isset($data['etag'])) {
         return \OCP\Config::setUserValue(\OCP\User::getUser(), 'files_sharing', 'etag', $data['etag']);
     } else {
         if ($cache = $this->getSourceCache($file)) {
             return $cache->put($this->files[$file], $data);
         }
     }
     return false;
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:19,代码来源:cache.php

示例13: setCalendarActive

 /**
  * @brief Sets a calendar (in)active
  * @param integer $id
  * @param boolean $active
  * @return boolean
  */
 public static function setCalendarActive($id, $active)
 {
     $userid = \OCP\User::getUser();
     $calendar = self::find($id);
     if ($calendar['userid'] !== $userid) {
         $sharedCalendar = \OCP\Share::getItemSharedWithBySource(App::SHARECALENDAR, App::SHARECALENDARPREFIX . $id);
         if ($sharedCalendar) {
             \OCP\Config::setUserValue($userid, App::$appname, 'calendar_' . $id, $active);
         }
     } else {
         $dbObject = \OC::$server->getDb();
         $calendarDB = new CalendarDAO($dbObject, $userid);
         $bUpdateCalendar = $calendarDB->activate($active, $id);
         return $bUpdateCalendar;
     }
     return true;
 }
开发者ID:Rotzbua,项目名称:calendarplus,代码行数:23,代码来源:calendar.php

示例14: scanCategories

 /**
  * scan vcards for categories.
  * @param $vccontacts VCards to scan. null to check all vcards for the current user.
  */
 public static function scanCategories($vccontacts = null)
 {
     if (\OCP\Config::getUserValue(\OCP\User::getUser(), 'contacts', 'categories_scanned', 'no') === 'yes') {
         return;
     }
     if (is_null($vccontacts)) {
         $vcaddressbooks = Addressbook::all(\OCP\USER::getUser());
         if (count($vcaddressbooks) > 0) {
             $vcaddressbookids = array();
             foreach ($vcaddressbooks as $vcaddressbook) {
                 if ($vcaddressbook['userid'] === \OCP\User::getUser()) {
                     $vcaddressbookids[] = $vcaddressbook['id'];
                 }
             }
             $start = 0;
             $batchsize = 10;
             $categories = new \OC_VCategories('contact');
             while ($vccontacts = VCard::all($vcaddressbookids, $start, $batchsize)) {
                 $cards = array();
                 foreach ($vccontacts as $vccontact) {
                     $cards[] = array($vccontact['id'], $vccontact['carddata']);
                 }
                 \OCP\Util::writeLog('contacts', __CLASS__ . '::' . __METHOD__ . ', scanning: ' . $batchsize . ' starting from ' . $start, \OCP\Util::DEBUG);
                 // only reset on first batch.
                 $categories->rescan($cards, true, $start == 0 ? true : false);
                 $start += $batchsize;
             }
         }
     }
     \OCP\Config::setUserValue(\OCP\User::getUser(), 'contacts', 'categories_scanned', 'yes');
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:35,代码来源:app.php

示例15: set

 /**
  * @brief set user config value
  *
  * @param string $key key for value to change
  * @param string $value value to use
  * @return bool success
  */
 public static function set($key, $value)
 {
     return \OCP\Config::setUserValue(\OCP\User::getUser(), 'files_opds', $key, $value);
 }
开发者ID:RavenB,项目名称:owncloud-apps,代码行数:11,代码来源:config.php


注:本文中的OCP\Config::setUserValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。