def prefs(request): """ Preferences form :param request: """ # Redirects to index if no preferences change allowed if GlobalConfig.PREFERENCES_ALLOWED.getBool(True) is False: return redirect('uds.web.views.index') if request.method == 'POST': UserPrefsManager.manager().processRequestForUserPreferences(request.user, request.POST) return redirect('uds.web.views.index') prefs_form = UserPrefsManager().manager().getHtmlForUserPreferences(request.user) return render(request, theme.template('prefs.html'), {'prefs_form': prefs_form})
def prefs(request): """ Preferences form :param request: """ # Redirects to index if no preferences change allowed if GlobalConfig.PREFERENCES_ALLOWED.getBool(True) is False: return redirect("uds.web.views.index") if request.method == "POST": UserPrefsManager.manager().processRequestForUserPreferences(request.user, request.POST) return redirect("uds.web.views.index") prefs_form = UserPrefsManager().manager().getHtmlForUserPreferences(request.user) return render_to_response( theme.template("prefs.html"), {"prefs_form": prefs_form}, context_instance=RequestContext(request) )
def prefs(self, modName): ''' Returns the preferences for this user for the provided module name. Usually preferences will be associated with transports, but can be preferences registered by ANY module. Args: modName: name of the module to get preferences for Returns: The preferences for the module specified as a dictionary (can be empty if module is not found). If the module exists, the preferences will always contain something, but may be the values are the default ones. ''' from uds.core.managers.UserPrefsManager import UserPrefsManager return UserPrefsManager.manager().getPreferencesForUser(modName, self)
# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' @author: Adolfo Gómez, dkmaster at dkmon dot com ''' from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs from uds.core.managers.DownloadsManager import DownloadsManager from uds.core.util.Config import Config from TSNXTransport import TSNXTransport from django.utils.translation import ugettext_noop as _ import os.path, sys Config.section('NX').value('downloadUrl', 'http://www.nomachine.com/download-3').get() Config.section('NX').value('downloadUrlMACOS', 'http://opennx.net/download.html').get() UserPrefsManager.manager().registerPrefs('nx', _('NX Protocol'), [ CommonPrefs.screenSizePref ])
# this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # * Neither the name of Virtual Cable S.L. nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' @author: Adolfo Gómez, dkmaster at dkmon dot com ''' from django.utils.translation import ugettext_noop as _ from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs from .X2GOTransport import X2GOTransport from .TX2GOTransport import TX2GOTransport # We will use same prefs as for NX, X2GO is based on it UserPrefsManager.manager().registerPrefs('nx', _('NX/X2GO'), [CommonPrefs.screenSizePref])
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' @author: Adolfo Gómez, dkmaster at dkmon dot com ''' from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs from uds.core.managers.DownloadsManager import DownloadsManager from uds.core.util.Config import Config from .NXTransport import NXTransport from .TSNXTransport import TSNXTransport from django.utils.translation import ugettext_noop as _ import os.path Config.section('NX').value('downloadUrl', 'http://sourceforge.net/projects/opennx/files/opennx/CI-win32/OpenNX-0.16.0.725-Setup.exe/download').get() Config.section('NX').value('downloadUrlMACOS', 'http://opennx.net/download.html').get() UserPrefsManager.manager().registerPrefs('nx', _('NX/X2GO'), [CommonPrefs.screenSizePref]) # DownloadsManager.manager().registerDownloadable('udsactor-nx_1.0_all.deb', # _('UDS Actor connector for NX <b>(requires nomachine packages)</b>'), # os.path.dirname(sys.modules[__package__].__file__) + '/files/udsactor-nx_1.0_all.deb', # 'application/x-debian-package')
# may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' @author: Adolfo Gómez, dkmaster at dkmon dot com ''' from django.utils.translation import ugettext_noop as _ from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs from .RDPTransport import RDPTransport from .TRDPTransport import TRDPTransport UserPrefsManager.manager().registerPrefs('rdp', _('Remote Desktop Protocol'), [ CommonPrefs.screenSizePref, CommonPrefs.depthPref ] )
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' @author: Adolfo Gómez, dkmaster at dkmon dot com ''' from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs from uds.core.managers.DownloadsManager import DownloadsManager from uds.core.util.Config import Config from NXTransport import NXTransport from django.utils.translation import ugettext_noop as _ import os.path, sys Config.section('NX').value( 'downloadUrl', 'http://sourceforge.net/projects/opennx/files/opennx/CI-win32/OpenNX-0.16.0.725-Setup.exe/download' ).get() Config.section('NX').value('downloadUrlMACOS', 'http://opennx.net/download.html').get() UserPrefsManager.manager().registerPrefs('nx', _('NX Protocol'), [CommonPrefs.screenSizePref]) # DownloadsManager.manager().registerDownloadable('udsactor-nx_1.0_all.deb', # _('UDS Actor connector for NX <b>(requires nomachine packages)</b>'), # os.path.dirname(sys.modules[__package__].__file__) + '/files/udsactor-nx_1.0_all.deb', # 'application/x-debian-package')
def plugin_detection(request, detection): if detection != '0': detection = '1' UserPrefsManager.manager().setPreferenceForUser(request.user, '_uds', CommonPrefs.BYPASS_PREF, detection) return HttpResponse(content='', content_type='text/plain')
from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs from uds.core.auths.auth import webLoginRequired from uds.core.ui import theme from uds.core.util.OsDetector import desktopOss import logging logger = logging.getLogger(__name__) __updated__ = '2015-04-28' UserPrefsManager.manager().registerPrefs( '_uds', ugettext_noop('UDS Plugin preferences'), [ CommonPrefs.bypassPluginDetectionPref ] ) def client_downloads(request, os=None): ''' Download page for UDS plugins ''' if os not in desktopOss: os = request.os['OS'] logger.debug('User: {}'.format(request.user)) os = os.lower() return render_to_response(theme.template('download_client.html'), {'os': os, 'user': request.user},
from django.utils.translation import ugettext_noop from django.shortcuts import render_to_response from django.template import RequestContext from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs from uds.core.auths.auth import webLoginRequired from uds.core.ui import theme from uds.core.util.OsDetector import desktopOss import logging logger = logging.getLogger(__name__) UserPrefsManager.manager().registerPrefs( '_uds', ugettext_noop('UDS Plugin preferences'), [CommonPrefs.bypassPluginDetectionPref]) def client_downloads(request, os=None): ''' Download page for UDS plugins ''' if os not in desktopOss: os = request.os['OS'] logger.debug('User: {}'.format(request.user)) os = os.lower() return render_to_response(theme.template('download_client.html'), { 'os': os, 'user': request.user },