Develop and Download Open Source Software

Browse CVS Repository

Annotation of /xoonips/AL/commonal.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download) (as text)
Thu Nov 25 05:14:58 2004 UTC (19 years, 4 months ago) by youi
Branch: MAIN
File MIME type: text/x-c++src
initial version

1 youi 1.1 /*
2     *
3     * $Revision$
4     * $Log$
5     *
6     */
7    
8     #include <stdio.h>
9     #include <string.h>
10     #include <mysql.h>
11    
12     #include "common.h"
13     #include "account.h"
14     #include "group.h"
15     #include "session.h"
16     #include "criteria.h"
17     #include "commonal.h"
18    
19     static MYSQL* mysql = NULL; //!< MySQLのハンドル
20    
21     /**
22     *
23     * データベースの初期化
24     *
25     * @param host データベースのホスト名
26     * @param user データベースにアクセスするユーザ名
27     * @param password 上記ユーザのパスワード
28     * @param dbname データベースの名前
29     * @param prefix XOOPSデータベーステーブルのPREFIX
30     * @return result_t
31     * @refer result_t
32     */
33     result_t initializeDB( const char* host, const char* user, const char* password, const char* dbname, const char* prefix )
34     {
35     // 既に接続中なら、一旦切断
36     if ( mysql != NULL )
37     mysql_close( mysql );
38    
39     // 初期化と接続
40     mysql = mysql_init(NULL);
41     if ( mysql == NULL ){
42     return RES_DB_INITIALIZE_ERROR;
43     }
44     char *unix_socket = NULL; // ?
45     uint flag = 0; // ?
46     if ( NULL == mysql_real_connect( mysql, host, user, password, dbname, 3306, unix_socket, flag ) ){
47     return RES_DB_CONNECT_ERROR;
48     }
49    
50     return RES_SUCCESS;
51     }
52    
53    
54     /**
55     *
56     * Platformユーザ承認状態取得
57     *
58     * @param
59     * @return
60     *
61     */
62     bool isActivated( session_t* sid, uid_t uid )
63     {
64     return false;
65     }
66    
67     /**
68     *
69     * Platformユーザ承認状態変更
70     *
71     * @param
72     * @return
73     *
74     */
75     result_t activate( session_t* sid, uid_t uid, bool activate )
76     {
77     return RES_ERROR;
78     }
79    
80     /**
81     *
82     * アカウント数
83     *
84     * @param
85     * @return
86     *
87     */
88     int getAccountCount( session_t* sid )
89     {
90     return 0;
91     }
92    
93     /**
94     *
95     * アカウント削除
96     *
97     * @param
98     * @return
99     *
100     */
101     result_t deleteAccount( session_t* sid, uid_t uid )
102     {
103     return RES_ERROR;
104     }
105    
106     /**
107     *
108     * アカウント情報取得
109     *
110     * @param
111     * @return
112     *
113     */
114     result_t getAccount( session_t* sid, uid_t uid, account_t**)
115     {
116     return RES_ERROR;
117     }
118    
119     /**
120     *
121     * アカウント情報取得
122     *
123     * @param
124     * @return
125     *
126     */
127     result_t getAccounts( session_t* sid, uid_t* uids, int uidsLen, criteria_t* cri, account_t** accounts, int* accountsLen )
128     {
129     return RES_ERROR;
130     }
131    
132     /**
133     *
134     * アカウント登録
135     *
136     * @param
137     * @return
138     *
139     */
140     result_t insertAccount( session_t* sid, account_t* account )
141     {
142     return RES_ERROR;
143     }
144    
145     /**
146     *
147     * アカウント変更
148     *
149     * @param
150     * @return
151     *
152     */
153     result_t updateAccount( session_t* sid, account_t* account )
154     {
155     return RES_ERROR;
156     }
157    
158     /**
159     *
160     * ユーザID一覧
161     *
162     * @param
163     * @return
164     *
165     */
166     result_t dumpUids( session_t* sid, criteria_t* cri, uid_t** uids, int* uidsLen )
167     {
168     return RES_ERROR;
169     }
170    
171     /**
172     *
173     * グループ数
174     *
175     * @param
176     * @return
177     *
178     */
179     int getGroupCount( session_t* sid )
180     {
181     return 0;
182     }
183    
184     /**
185     *
186     * 所属グループ一覧取得
187     *
188     * @param
189     * @return
190     *
191     */
192     result_t getGroupsByUid( session_t* sid, uid_t uid, criteria_t* cri, gid_t** gids, int* gidsLen )
193     {
194     return RES_ERROR;
195     }
196    
197     /**
198     *
199     * グループ管理権限問合せ
200     *
201     * @param
202     * @return
203     *
204     */
205     bool isGroupAdmin( session_t* sid, gid_t gid, uid_t uid )
206     {
207     return RES_ERROR;
208     }
209    
210     /**
211     *
212     * グループID一覧
213     *
214     * @param
215     * @return
216     *
217     */
218     result_t dumpGids( session_t* sid, criteria_t* cri, gid_t** gids, int* gidsLen )
219     {
220     return RES_ERROR;
221     }
222    
223     /**
224     *
225     * グループ管理者ID取得
226     *
227     * @param
228     * @return
229     *
230     */
231     result_t dumpGroupAdmins( session_t* sid, gid_t gid, criteria_t* cri, uid_t** uids, int* uidsLen )
232     {
233     return RES_ERROR;
234     }
235    
236     /**
237     *
238     * グループ所属ユーザ削除
239     *
240     * @param
241     * @return
242     *
243     */
244     result_t deleteMember( session_t* sid, gid_t gid, uid_t uid )
245     {
246     return RES_ERROR;
247     }
248    
249     /**
250     *
251     * グループ所属ユーザ追加
252     *
253     * @param
254     * @return
255     *
256     */
257     result_t insertMember( session_t* sid, gid_t gid, uid_t uid )
258     {
259     return RES_ERROR;
260     }
261    
262     /**
263     *
264     * グループ所属ユーザ取得
265     *
266     * @param
267     * @return
268     *
269     */
270     result_t getMembers( session_t* sid, gid_t gid, criteria_t* cri, uid_t** uids, int* uidsLen )
271     {
272     return RES_ERROR;
273     }
274    
275     /**
276     *
277     * グループの削除
278     *
279     * @param
280     * @return
281     *
282     */
283     result_t deleteGroup( session_t* sid, gid_t gid )
284     {
285     return RES_ERROR;
286     }
287    
288     /**
289     *
290     * グループの登録
291     *
292     * @param
293     * @return
294     *
295     */
296     result_t insertGroup( session_t* sid, group_t* group )
297     {
298     return RES_ERROR;
299     }
300    
301     /**
302     *
303     * グループの変更
304     *
305     * @param
306     * @return
307     *
308     */
309     result_t updateGroup( session_t* sid, group_t* group )
310     {
311     return RES_ERROR;
312     }
313    
314     /**
315     *
316     * グループ情報取得
317     *
318     * @param
319     * @return
320     *
321     */
322     result_t getGroup( session_t* sid, gid_t gid, group_t** group )
323     {
324     return RES_ERROR;
325     }
326    
327     /**
328     *
329     * グループ情報取得
330     *
331     * @param
332     * @return
333     *
334     */
335     result_t getGroups( session_t* sid, gid_t* gids, int gidsLen, criteria_t* cri, group_t** groups, int* groupsLen )
336     {
337     return RES_ERROR;
338     }
339    
340     /**
341     *
342     * モデレータ権限問合せ
343     *
344     * @param
345     * @return
346     *
347     */
348     bool isModerator( session_t* sid, uid_t uid )
349     {
350     return RES_ERROR;
351     }
352    
353     /**
354     *
355     * ユーザID取得
356     *
357     * @param
358     * @return
359     *
360     */
361     result_t getUid( const char* uname, uid_t** uid )
362     {
363     return RES_ERROR;
364     }
365    
366     /**
367     *
368     * ログイン認証とセッション作成
369     *
370     * @param
371     * @return
372     *
373     */
374     result_t loginUser(const char* uname, const char* passwd, session_t** sessions )
375     {
376     return RES_ERROR;
377     }
378    
379     /**
380     *
381     * ログアウトとセッション終了
382     *
383     * @param
384     * @return
385     *
386     */
387     void logoutUser( session_t* sid ){}
388    
389     /**
390     *
391     * セッションの作成.<br>
392     * XOOPSのsessionテーブルに記録されたsess_idと引数sessionidが等しけれ
393     * ば,session_tを作成する。
394     *
395     * @param
396     * @return
397     *
398     */
399     result_t createSession( const char* sessionid, uid_t uid, unsigned long remoteHost, session_t** sessions )
400     {
401     return RES_ERROR;
402     }
403    
404     /**
405     *
406     * セッションの詳細をsession_tで取得する.<br>
407     *
408     * @param
409     * @return
410     *
411     */
412     result_t getSessionDetail( sessionid_t sess_id, session_t** session )
413     {
414     return RES_ERROR;
415     }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26