| 1 |
/* |
| 2 |
* -------------------------------------------------------------------------- |
| 3 |
* XooNiPs Xoops modules for Neuroinformatics Platforms |
| 4 |
* Copyright (C) 2005 RIKEN, Japan. All rights reserved. |
| 5 |
* http://sourceforge.jp/projects/xoonips/ |
| 6 |
* -------------------------------------------------------------------------- |
| 7 |
* This program is free software; you can redistribute it and/or |
| 8 |
* modify it under the terms of the GNU General Public License |
| 9 |
* as published by the Free Software Foundation; either version 2 |
| 10 |
* of the License, or (at your option) any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this program; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 20 |
* -------------------------------------------------------------------------- |
| 21 |
* |
| 22 |
* XOOPS&Platform鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 23 |
* |
| 24 |
* $Revision: 1.8 $ |
| 25 |
* $Log: account.cc,v $ |
| 26 |
* Revision 1.8 2005/03/15 04:49:40 tani |
| 27 |
* 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申. |
| 28 |
* |
| 29 |
* Revision 1.7 2005/02/25 07:00:37 tani |
| 30 |
* item_number_limit, index_number_limit, item_storage_limit鐃緒申鐃緒申鐃緒申. |
| 31 |
* |
| 32 |
* Revision 1.6 2005/02/09 07:23:50 aga |
| 33 |
* 鐃緒申URL to My Personal Archive 鐃緒申DB鐃緒申AL鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申. |
| 34 |
* |
| 35 |
* Revision 1.5 2005/01/15 05:31:16 youi |
| 36 |
* userid_t鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申. |
| 37 |
* |
| 38 |
* Revision 1.4 2005/01/14 10:33:37 aga |
| 39 |
* 鐃緒申int privateIndexID鐃緒申鐃緒申鐃緒申. |
| 40 |
* |
| 41 |
* Revision 1.3 2004/12/01 10:28:58 youi |
| 42 |
* DB鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 43 |
* institute -> division |
| 44 |
* organizaion -> company_name |
| 45 |
* |
| 46 |
* Revision 1.2 2004/11/25 08:57:01 youi |
| 47 |
* 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申char*鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申0鐃緒申鐃緒申鐃緒申鐃緒申. |
| 48 |
* get鐃緒申鐃緒申鐃緒申鐃緒申const鐃緒申鐃緒申. |
| 49 |
* |
| 50 |
* Revision 1.1 2004/11/22 08:25:16 youi |
| 51 |
* initial version. |
| 52 |
* |
| 53 |
* |
| 54 |
*/ |
| 55 |
#include <time.h> |
| 56 |
#include <string.h> |
| 57 |
|
| 58 |
#include "account.h" |
| 59 |
#include "common.h" |
| 60 |
|
| 61 |
account::account() |
| 62 |
{ |
| 63 |
// char鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申0鐃緒申鐃緒申鐃緒申鐃緒申 |
| 64 |
address = 0; |
| 65 |
division = 0; |
| 66 |
tel = 0; |
| 67 |
company_name = 0; |
| 68 |
country = 0; |
| 69 |
zipcode = 0; |
| 70 |
fax = 0; |
| 71 |
uname = 0; |
| 72 |
name = 0; |
| 73 |
email = 0; |
| 74 |
url = 0; |
| 75 |
user_avatar = 0; |
| 76 |
user_icq = 0; |
| 77 |
user_from = 0; |
| 78 |
user_sig = 0; |
| 79 |
actkey = 0; |
| 80 |
user_aim = 0; |
| 81 |
user_yim = 0; |
| 82 |
user_msnm = 0; |
| 83 |
pass = 0; |
| 84 |
theme = 0; |
| 85 |
umode = 0; |
| 86 |
user_occ = 0; |
| 87 |
bio = 0; |
| 88 |
user_intrest = 0; |
| 89 |
itemStorageLimit = 0; |
| 90 |
|
| 91 |
uid = 0; |
| 92 |
activate = false; |
| 93 |
setValue( &address, "" ); |
| 94 |
setValue( &division, "" ); |
| 95 |
setValue( &tel, "" ); |
| 96 |
setValue( &company_name, "" ); |
| 97 |
setValue( &country, "" ); |
| 98 |
setValue( &zipcode, "" ); |
| 99 |
setValue( &fax, "" ); |
| 100 |
noticeMail = 1; |
| 101 |
noticeMailSince = 0; |
| 102 |
privateIndexID = 0; |
| 103 |
|
| 104 |
setValue( &uname, "" ); |
| 105 |
setValue( &name, "" ); |
| 106 |
setValue( &email, "" ); |
| 107 |
setValue( &url, "" ); |
| 108 |
setValue( &user_avatar, "" ); |
| 109 |
user_regdate = 0; |
| 110 |
setValue( &user_icq, "" ); |
| 111 |
setValue( &user_from, "" ); |
| 112 |
setValue( &user_sig, "" ); |
| 113 |
user_viewemail = 0; |
| 114 |
setValue( &actkey, "" ); |
| 115 |
setValue( &user_aim, "" ); |
| 116 |
setValue( &user_yim, "" ); |
| 117 |
setValue( &user_msnm, "" ); |
| 118 |
setValue( &pass, "" ); |
| 119 |
posts = 0; |
| 120 |
attachsig = 0; |
| 121 |
rank = 0; |
| 122 |
level = 0; |
| 123 |
setValue( &theme, "" ); |
| 124 |
timezone_offset = 0.0; |
| 125 |
last_login = 0; |
| 126 |
setValue( &umode, "" ); |
| 127 |
uorder = 0; |
| 128 |
notify_method = 0; |
| 129 |
notify_mode = 0; |
| 130 |
setValue( &user_occ, "" ); |
| 131 |
setValue( &bio, "" ); |
| 132 |
setValue( &user_intrest, "" ); |
| 133 |
user_mailok = 0; |
| 134 |
} |
| 135 |
|
| 136 |
account::~account() |
| 137 |
{ |
| 138 |
if( address != 0 ) delete[] address; |
| 139 |
if( division != 0 ) delete[] division; |
| 140 |
if( tel != 0 ) delete[] tel; |
| 141 |
if( company_name != 0 ) delete[] company_name; |
| 142 |
if( country != 0 ) delete[] country; |
| 143 |
if( zipcode != 0 ) delete[] zipcode; |
| 144 |
if( fax != 0 ) delete[] fax; |
| 145 |
|
| 146 |
if( uname != 0 ) delete[] uname; |
| 147 |
if( name != 0 ) delete[] name; |
| 148 |
if( email != 0 ) delete[] email; |
| 149 |
if( url != 0 ) delete[] url; |
| 150 |
if( user_avatar != 0 ) delete[] user_avatar; |
| 151 |
if( user_icq != 0 ) delete[] user_icq; |
| 152 |
if( user_from != 0 ) delete[] user_from; |
| 153 |
if( user_sig != 0 ) delete[] user_sig; |
| 154 |
if( actkey != 0 ) delete[] actkey; |
| 155 |
if( user_aim != 0 ) delete[] user_aim; |
| 156 |
if( user_yim != 0 ) delete[] user_yim; |
| 157 |
if( user_msnm != 0 ) delete[] user_msnm; |
| 158 |
if( pass != 0 ) delete[] pass; |
| 159 |
if( theme != 0 ) delete[] theme; |
| 160 |
if( umode != 0 ) delete[] umode; |
| 161 |
if( user_occ != 0 ) delete[] user_occ; |
| 162 |
if( bio != 0 ) delete[] bio; |
| 163 |
if( user_intrest != 0 ) delete[] user_intrest; |
| 164 |
} |
| 165 |
|
| 166 |
userid_t account::getUID() const { return uid; } |
| 167 |
|
| 168 |
bool account::getActivate() const { return activate; } |
| 169 |
|
| 170 |
const char * account::getAddress() const { return address; } |
| 171 |
|
| 172 |
const char * account::getDivision() const { return division; } |
| 173 |
|
| 174 |
const char * account::getTel() const { return tel; } |
| 175 |
|
| 176 |
const char * account::getCompanyName() const { return company_name; } |
| 177 |
|
| 178 |
const char * account::getCountry() const { return country; } |
| 179 |
|
| 180 |
const char * account::getZipcode() const { return zipcode; } |
| 181 |
|
| 182 |
const char * account::getFax() const { return fax; } |
| 183 |
|
| 184 |
int account::getNoticeMail() const { return noticeMail; } |
| 185 |
|
| 186 |
time_t account::getNoticeMailSince() const { return noticeMailSince; } |
| 187 |
|
| 188 |
int account::getPrivateIndexID() const { return privateIndexID; } |
| 189 |
|
| 190 |
int account::getItemNumberLimit() const { return itemNumberLimit; } |
| 191 |
|
| 192 |
int account::getIndexNumberLimit() const { return indexNumberLimit; } |
| 193 |
|
| 194 |
double account::getItemStorageLimit() const { return itemStorageLimit; } |
| 195 |
|
| 196 |
// xoops_user |
| 197 |
const char* account::getUname( ) const { return uname; } |
| 198 |
|
| 199 |
const char* account::getName( ) const { return name; } |
| 200 |
|
| 201 |
const char* account::getEmail( ) const { return email; } |
| 202 |
|
| 203 |
const char* account::getURL( ) const { return url; } |
| 204 |
|
| 205 |
const char* account::getUserAvatar( ) const { return user_avatar; } |
| 206 |
|
| 207 |
int account::getUserRegdate( ) const { return user_regdate; } |
| 208 |
|
| 209 |
const char* account::getUserIcq( ) const { return user_icq; } |
| 210 |
|
| 211 |
const char* account::getUserFrom( ) const { return user_from; } |
| 212 |
|
| 213 |
const char* account::getUserSig( ) const { return user_sig; } |
| 214 |
|
| 215 |
int account::getUserViewemail( ) const { return user_viewemail; } |
| 216 |
|
| 217 |
const char* account::getActkey( ) const { return actkey; } |
| 218 |
|
| 219 |
const char* account::getUserAim( ) const { return user_aim; } |
| 220 |
|
| 221 |
const char* account::getUserYim( ) const { return user_yim; } |
| 222 |
|
| 223 |
const char* account::getUserMsnm( ) const { return user_msnm; } |
| 224 |
|
| 225 |
const char* account::getPass( ) const { return pass; } |
| 226 |
|
| 227 |
int account::getPosts( ) const { return posts; } |
| 228 |
|
| 229 |
int account::getAttachsig( ) const { return attachsig; } |
| 230 |
|
| 231 |
int account::getRank( ) const { return rank; } |
| 232 |
|
| 233 |
int account::getLevel( ) const { return level; } |
| 234 |
|
| 235 |
const char* account::getTheme( ) const { return theme; } |
| 236 |
|
| 237 |
double account::getTimezoneOffset( ) const { return timezone_offset; } |
| 238 |
|
| 239 |
int account::getLastLogin( ) const { return last_login; } |
| 240 |
|
| 241 |
const char* account::getUmode( ) const { return umode; } |
| 242 |
|
| 243 |
int account::getUorder( ) const { return uorder; } |
| 244 |
|
| 245 |
int account::getNotifyMethod( ) const { return notify_method; } |
| 246 |
|
| 247 |
int account::getNotifyMode( ) const { return notify_mode; } |
| 248 |
|
| 249 |
const char* account::getUserOcc( ) const { return user_occ; } |
| 250 |
|
| 251 |
const char* account::getBio( ) const { return bio; } |
| 252 |
|
| 253 |
const char* account::getUserIntrest( ) const { return user_intrest; } |
| 254 |
|
| 255 |
int account::getUserMailok( ) const { return user_mailok; } |
| 256 |
|
| 257 |
|
| 258 |
// |
| 259 |
void account::setUID(userid_t uid){ this -> uid = uid; } |
| 260 |
|
| 261 |
void account::setActivate(bool activate){ this -> activate = activate; } |
| 262 |
|
| 263 |
void account::setAddress( const char* address) |
| 264 |
{ |
| 265 |
setValue( &this -> address, address ); |
| 266 |
} |
| 267 |
|
| 268 |
void account::setDivision( const char* division) |
| 269 |
{ |
| 270 |
setValue( &this -> division, division ); |
| 271 |
} |
| 272 |
|
| 273 |
void account::setTel( const char* tel) |
| 274 |
{ |
| 275 |
setValue( &this -> tel, tel ); |
| 276 |
} |
| 277 |
|
| 278 |
void account::setCompanyName( const char* company_name) |
| 279 |
{ |
| 280 |
setValue( &this -> company_name, company_name ); |
| 281 |
} |
| 282 |
|
| 283 |
void account::setCountry( const char* country) |
| 284 |
{ |
| 285 |
setValue( &this -> country, country ); |
| 286 |
} |
| 287 |
|
| 288 |
void account::setZipcode( const char* zipcode) |
| 289 |
{ |
| 290 |
setValue( &this -> zipcode, zipcode ); |
| 291 |
} |
| 292 |
|
| 293 |
void account::setFax( const char* fax) |
| 294 |
{ |
| 295 |
setValue( &this -> fax, fax ); |
| 296 |
} |
| 297 |
|
| 298 |
void account::setNoticeMail(int noticeMail){ this -> noticeMail = noticeMail; } |
| 299 |
|
| 300 |
void account::setNoticeMailSince(time_t noticeMailSince){ this -> noticeMailSince = noticeMailSince; } |
| 301 |
|
| 302 |
void account::setPrivateIndexID(int xid){ this -> privateIndexID = xid; } |
| 303 |
|
| 304 |
void account::setItemNumberLimit( int x ){ itemNumberLimit = x; } |
| 305 |
|
| 306 |
void account::setIndexNumberLimit( int x ){ indexNumberLimit = x; } |
| 307 |
|
| 308 |
void account::setItemStorageLimit( double x ){ itemStorageLimit = x; } |
| 309 |
|
| 310 |
// xoops_user |
| 311 |
void account::setUname( const char* uname ) |
| 312 |
{ |
| 313 |
setValue( &this -> uname, uname ); |
| 314 |
} |
| 315 |
|
| 316 |
void account::setName( const char* name ) |
| 317 |
{ |
| 318 |
setValue( &this -> name, name ); |
| 319 |
} |
| 320 |
|
| 321 |
void account::setEmail( const char* email ) |
| 322 |
{ |
| 323 |
setValue( &this -> email, email ); |
| 324 |
} |
| 325 |
|
| 326 |
void account::setURL( const char* url ) |
| 327 |
{ |
| 328 |
setValue( &this -> url, url ); |
| 329 |
} |
| 330 |
|
| 331 |
void account::setUserAvatar( const char* user_avatar ) |
| 332 |
{ |
| 333 |
setValue( &this -> user_avatar, user_avatar ); |
| 334 |
} |
| 335 |
|
| 336 |
void account::setUserRegdate( int user_regdate ){ this -> user_regdate = user_regdate; } |
| 337 |
|
| 338 |
void account::setUserIcq( const char* user_icq ) |
| 339 |
{ |
| 340 |
setValue( &this -> user_icq, user_icq ); |
| 341 |
} |
| 342 |
|
| 343 |
void account::setUserFrom( const char* user_from ) |
| 344 |
{ |
| 345 |
setValue( &this -> user_from, user_from ); |
| 346 |
} |
| 347 |
|
| 348 |
void account::setUserSig( const char* user_sig ) |
| 349 |
{ |
| 350 |
setValue( &this -> user_sig, user_sig ); |
| 351 |
} |
| 352 |
|
| 353 |
void account::setUserViewemail( int user_viewemail ){ this -> user_viewemail = user_viewemail; } |
| 354 |
|
| 355 |
void account::setActkey( const char* actkey ) |
| 356 |
{ |
| 357 |
setValue( &this -> actkey, actkey ); |
| 358 |
} |
| 359 |
|
| 360 |
void account::setUserAim( const char* user_aim ) |
| 361 |
{ |
| 362 |
setValue( &this -> user_aim, user_aim ); |
| 363 |
} |
| 364 |
|
| 365 |
void account::setUserYim( const char* user_yim ) |
| 366 |
{ |
| 367 |
setValue( &this -> user_yim, user_yim ); |
| 368 |
} |
| 369 |
|
| 370 |
void account::setUserMsnm( const char* user_msnm ) |
| 371 |
{ |
| 372 |
setValue( &this -> user_msnm, user_msnm ); |
| 373 |
} |
| 374 |
|
| 375 |
|
| 376 |
void account::setPass( const char* pass ) |
| 377 |
{ |
| 378 |
setValue( &this -> pass, pass ); |
| 379 |
} |
| 380 |
|
| 381 |
void account::setPosts( int posts ){ this -> posts = posts; } |
| 382 |
|
| 383 |
void account::setAttachsig( int attachsig ){ this -> attachsig = attachsig; } |
| 384 |
|
| 385 |
void account::setRank( int rank ){ this -> rank = rank; } |
| 386 |
|
| 387 |
void account::setLevel( int level ){ this -> level = level; } |
| 388 |
|
| 389 |
void account::setTheme( const char* theme ) |
| 390 |
{ |
| 391 |
setValue( &this -> theme, theme ); |
| 392 |
} |
| 393 |
|
| 394 |
void account::setTimezoneOffset( double timezone_offset ){ this -> timezone_offset = timezone_offset; } |
| 395 |
|
| 396 |
void account::setLastLogin( int last_login ){ this -> last_login = last_login; } |
| 397 |
|
| 398 |
void account::setUmode( const char* umode ) |
| 399 |
{ |
| 400 |
setValue( &this -> umode, umode ); |
| 401 |
} |
| 402 |
|
| 403 |
void account::setUorder( int uorder ){ this -> uorder = uorder; } |
| 404 |
|
| 405 |
void account::setNotifyMethod( int notify_method ){ this -> notify_method = notify_method; } |
| 406 |
|
| 407 |
void account::setNotifyMode( int notify_mode ){ this -> notify_mode = notify_mode; } |
| 408 |
|
| 409 |
void account::setUserOcc( const char* user_occ ) |
| 410 |
{ |
| 411 |
setValue( &this -> user_occ, user_occ ); |
| 412 |
} |
| 413 |
|
| 414 |
|
| 415 |
void account::setBio( const char* bio ) |
| 416 |
{ |
| 417 |
setValue( &this -> bio, bio ); |
| 418 |
} |
| 419 |
|
| 420 |
void account::setUserIntrest( const char* user_intrest ) |
| 421 |
{ |
| 422 |
setValue( &this->user_intrest, user_intrest ); |
| 423 |
} |
| 424 |
|
| 425 |
void account::setUserMailok( int user_mailok ){ this -> user_mailok = user_mailok; } |
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
|