You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
4.2 KiB
101 lines
4.2 KiB
11 years ago
|
#-*- coding: utf-8 -*-
|
||
|
|
||
11 years ago
|
# Copyright 2012-2013 Calculate Ltd. http://www.calculate-linux.org
|
||
12 years ago
|
#
|
||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
# you may not use this file except in compliance with the License.
|
||
|
# You may obtain a copy of the License at
|
||
|
#
|
||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||
|
#
|
||
|
# Unless required by applicable law or agreed to in writing, software
|
||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
# See the License for the specific language governing permissions and
|
||
|
# limitations under the License.
|
||
11 years ago
|
import sys, time, os
|
||
12 years ago
|
|
||
11 years ago
|
from calculate.lib.datavars import VariableError,DataVarsError,DataVars
|
||
|
from calculate.core.server.func import WsdlBase
|
||
|
from desktop import DesktopError
|
||
|
from utils.cl_desktop import ClDesktopLogoutAction,ClDesktopAction
|
||
|
import desktop
|
||
12 years ago
|
|
||
|
from calculate.lib.cl_lang import setLocalTranslate,getLazyLocalTranslate
|
||
|
setLocalTranslate('cl_desktop3',sys.modules[__name__])
|
||
|
__ = getLazyLocalTranslate(_)
|
||
|
|
||
11 years ago
|
|
||
11 years ago
|
class Wsdl(WsdlBase):
|
||
|
methods = [
|
||
|
#
|
||
|
# вывести пользователя из сеанса
|
||
|
#
|
||
|
{
|
||
|
# идентификатор метода
|
||
|
'method_name':"desktop_logout",
|
||
|
# категория метода
|
||
|
'category':__('Desktop'),
|
||
|
# заголовок метода
|
||
10 years ago
|
'title':__("User Logout"),
|
||
11 years ago
|
# иконка для графической консоли
|
||
|
'image':'system-log-out',
|
||
|
# метод присутствует в графической консоли
|
||
|
'gui':True,
|
||
|
# консольная команда
|
||
|
'command':'cl-desktop-logout',
|
||
|
# права для запуска метода
|
||
|
'rights':['userconfigure'],
|
||
|
# объект содержащий модули для действия
|
||
|
'logic':{'Desktop':desktop.Desktop},
|
||
|
# описание действия
|
||
|
'action':ClDesktopLogoutAction,
|
||
|
# объект переменных
|
||
|
'datavars':"desktop",
|
||
|
'native_error':(VariableError,DataVarsError,
|
||
|
DesktopError),
|
||
|
# значения по умолчанию для переменных этого метода
|
||
|
'setvars':{'cl_action!':'logout'},
|
||
|
# описание груп (список лямбда функций)
|
||
|
'groups':[
|
||
11 years ago
|
lambda group:group(_("User logout"),
|
||
11 years ago
|
normal=('cl_desktop_login',),
|
||
|
next_label=_("Logout"))]},
|
||
|
#
|
||
|
# настроить пользовательский сеанс
|
||
|
#
|
||
|
{
|
||
|
# идентификатор метода
|
||
|
'method_name':"desktop",
|
||
|
# категория метода
|
||
|
'category':__('Desktop'),
|
||
|
# заголовок метода
|
||
10 years ago
|
'title':__("Configure User"),
|
||
11 years ago
|
# иконка для графической консоли
|
||
|
'image':'user-desktop,preferences-desktop',
|
||
|
# метод присутствует в графической консоли
|
||
|
'gui':True,
|
||
|
# консольная команда
|
||
|
'command':'cl-desktop',
|
||
|
# права для запуска метода
|
||
|
'rights':['userconfigure'],
|
||
|
# объект содержащий модули для действия
|
||
11 years ago
|
'logic':{'Desktop':desktop.Desktop},
|
||
11 years ago
|
# описание действия
|
||
|
'action':ClDesktopAction,
|
||
|
# объект переменных
|
||
|
'datavars':"desktop",
|
||
|
'native_error':(VariableError,DataVarsError,
|
||
|
DesktopError),
|
||
|
# значения по умолчанию для переменных этого метода
|
||
11 years ago
|
'setvars':{'cl_action!':'desktop',
|
||
|
'cl_protect_use_set!':'off'},
|
||
11 years ago
|
# описание груп (список лямбда функций)
|
||
|
'groups':[
|
||
|
lambda group:group(_("Configure user"),
|
||
|
normal=('ur_login',),
|
||
11 years ago
|
expert=('cl_desktop_force_setup_set','cl_verbose_set',
|
||
|
'cl_templates_locate'),
|
||
11 years ago
|
next_label=_("Configure"))]},
|
||
|
]
|