]> git.stg.codes - stg.git/blob - doc/xmlrpc/API-system.xml
User parser refactoring.
[stg.git] / doc / xmlrpc / API-system.xml
1 <?xml version='1.0' encoding='UTF-8'?>
2 <chapter xmlns="http://docbook.org/ns/docbook">
3     <title>Авторизация в системе</title>
4     <para>В этом разделе собраны функции, не относящиеся к манипулированию сущностями системы. А именно: отвечающие за авторизацию в системе, получение информации о системе и т.д.</para>
5     <refentry id="stargazer.login">
6         <refmeta>
7             <refentrytitle>stargazer.login</refentrytitle>
8         </refmeta>
9         <refnamediv>
10             <refname>stargazer.login</refname>
11             <refpurpose>Авторизация администратора в системе</refpurpose>
12         </refnamediv>
13         <refsynopsisdiv>
14             <funcsynopsis>
15                 <funcprototype>
16                     <funcdef><function>stargazer.login</function></funcdef>
17                     <paramdef>string <parameter>login</parameter></paramdef>
18                     <paramdef>string <parameter>password</parameter></paramdef>
19                 </funcprototype>
20             </funcsynopsis>
21         </refsynopsisdiv>
22         <refsect1>
23             <title>Description</title>
24             <para>Метод <function>stargazer.login</function> авторизует администратора в системе. Если логин и пароль корректные - создается cookie и открывается сессия. В дальнейшем все вызовы API получают этот cookie. Если указаный администратор в системе не найден или его пароль не совпадает - сессия не открывается и cookie не создается.</para>
25             <variablelist>
26                 <varlistentry>
27                     <term>string <parameter>login</parameter></term>
28                     <listitem>
29                         <para>Логин администратора</para>
30                     </listitem>
31                 </varlistentry>
32                 <varlistentry>
33                     <term>string <parameter>password</parameter></term>
34                     <listitem>
35                         <para>Пароль администратора</para>
36                     </listitem>
37                 </varlistentry>
38             </variablelist>
39             <refsect2>
40                 <title>Return Value</title>
41                 <para>
42                     Возвращает структуру:
43                     <variablelist>
44                         <varlistentry>
45                             <term>bool <structfield>result</structfield></term>
46                             <listitem>
47                                 <para>Результат операции. true - авторизация прошла успешно, false - авторизация завершилась неудачей.</para>
48                             </listitem>
49                         </varlistentry>
50                         <varlistentry>
51                             <term>string <structfield>cookie</structfield></term>
52                             <listitem>
53                                 <para>Авторизационный cookie. В случе успешной авторизации представляет собой строку из 64 символов, передаваемую во все вызовы API. В случае неудачи - пустая строка.</para>
54                             </listitem>
55                         </varlistentry>
56                     </variablelist>
57                 </para>
58             </refsect2>
59         </refsect1>
60         <refsect1>
61             <title>See also</title>
62             <para><link linkend="stargazer.logout">stargazer.logout</link></para>
63         </refsect1>
64     </refentry>
65     <refentry id="stargazer.logout">
66         <refmeta>
67             <refentrytitle>stargazer.logout</refentrytitle>
68         </refmeta>
69         <refnamediv>
70             <refname>stargazer.logout</refname>
71             <refpurpose>Завершение сессии администратора в системе</refpurpose>
72         </refnamediv>
73         <refsynopsisdiv>
74             <funcsynopsis>
75                 <funcprototype>
76                     <funcdef><function>stargazer.logout</function></funcdef>
77                     <paramdef>string <parameter>cookie</parameter></paramdef>
78                 </funcprototype>
79             </funcsynopsis>
80         </refsynopsisdiv>
81         <refsect1>
82             <title>Description</title>
83             <para>Метод <function>stargazer.logout</function> завершает сеанс работы авторизатора в системе.</para>
84             <variablelist>
85                 <varlistentry>
86                     <term>string <parameter>cookie</parameter></term>
87                     <listitem>
88                         <para>Авторизационный cookie</para>
89                     </listitem>
90                 </varlistentry>
91             </variablelist>
92             <refsect2>
93                 <title>Return Value</title>
94                 <para>Возвращает true в случае успеха и false в случае неудачи.</para>
95             </refsect2>
96         </refsect1>
97         <refsect1>
98             <title>See also</title>
99             <para><link linkend="stargazer.login">stargazer.login</link></para>
100         </refsect1>
101     </refentry>
102     <refentry id="stargazer.info">
103         <refmeta>
104             <refentrytitle>stargazer.info</refentrytitle>
105         </refmeta>
106         <refnamediv>
107             <refname>stargazer.info</refname>
108             <refpurpose>Информация о сервере</refpurpose>
109         </refnamediv>
110         <refsynopsisdiv>
111             <funcsynopsis>
112                 <funcprototype>
113                     <funcdef><function>stargazer.info</function></funcdef>
114                 </funcprototype>
115             </funcsynopsis>
116         </refsynopsisdiv>
117         <refsect1>
118             <title>Description</title>
119             <para>Метод <function>stargazer.info</function> возвращает информацию о сервере Stargazer. Не требует авторизации.</para>
120             <refsect2>
121                 <title>Return Value</title>
122                 <para>
123                     Возвращает структуру:
124                     <variablelist>
125                         <varlistentry>
126                             <term>string <structfield>version</structfield></term>
127                             <listitem>
128                                 <para>Версия Stargazer</para>
129                             </listitem>
130                         </varlistentry>
131                         <varlistentry>
132                             <term>int <structfield>tariff_num</structfield></term>
133                             <listitem>
134                                 <para>Количество тарифов в системе</para>
135                             </listitem>
136                         </varlistentry>
137                         <varlistentry>
138                             <term>int <structfield>tariff</structfield></term>
139                             <listitem>
140                                 <para>Версия тарифов (обычно 2)</para>
141                             </listitem>
142                         </varlistentry>
143                         <varlistentry>
144                             <term>int <structfield>users_num</structfield></term>
145                             <listitem>
146                                 <para>Количество зарегистрированных пользователей в системе</para>
147                             </listitem>
148                         </varlistentry>
149                         <varlistentry>
150                             <term>string <structfield>uname</structfield></term>
151                             <listitem>
152                                 <para>Строка uname</para>
153                             </listitem>
154                         </varlistentry>
155                         <varlistentry>
156                             <term>int <structfield>dir_num</structfield></term>
157                             <listitem>
158                                 <para>Количество тарифицируемых направлений</para>
159                             </listitem>
160                         </varlistentry>
161                         <varlistentry>
162                             <term>int <structfield>day_fee</structfield></term>
163                             <listitem>
164                                 <para>День снятия абонплаты</para>
165                             </listitem>
166                         </varlistentry>
167                         <varlistentry>
168                             <term>array of strings <structfield>dir_names</structfield></term>
169                             <listitem>
170                                 <para>Названия направлений</para>
171                             </listitem>
172                         </varlistentry>
173                     </variablelist>
174                 </para>
175             </refsect2>
176         </refsect1>
177     </refentry>
178 </chapter>
179