PageRenderTime 196ms CodeModel.GetById 41ms RepoModel.GetById 7ms app.codeStats 1ms

/app/controllers/users_controller.php

https://bitbucket.org/fxrialab/tickets
PHP | 2832 lines | 2162 code | 448 blank | 222 comment | 429 complexity | 65c87845cbaaff9e94f33200e3f126cf MD5 | raw file
Possible License(s): LGPL-2.1, AGPL-1.0, GPL-2.0, MIT

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. class UsersController extends AppController {
  3. var $name='Users';
  4. var $components = array('Pagination','Thumbnail','Thumbnailc','Sendmail'); // ,'Cakephpbb' for phpbb componrent - not need
  5. var $helpers = array('javascript', 'error', 'Pagination','Ajax','Friendsurl');
  6. //this function is used to display the comming soon page
  7. //delete this function along with LAYOUT = FALASE and VIEW - FALSEINDEX
  8. function falseindex() {
  9. $this->layout = 'false';
  10. }
  11. function index() {
  12. $this->layout = 'default';
  13. $this->checkSession();
  14. }
  15. function sendforgotpassword() {
  16. if(isset($this->data['User']['userForgotName']) && $this->data['User']['userForgotName']!='') {
  17. $forgotuser = "SELECT password,id from users where username='".mysql_escape_string($this->data['User']['userForgotName'])."' ";
  18. $forgotuser_res = mysql_query($forgotuser);
  19. if(mysql_num_rows($forgotuser_res)>0) {
  20. $forgotuser_arr = mysql_fetch_array($forgotuser_res);
  21. $userDetails=$this->getUserDetails($forgotuser_arr['id']);
  22. $this->set('receiptInfo',$userDetails);
  23. ####### MAIL TEMPLATE
  24. $this->Sendmail->Mail();
  25. $this->Sendmail->From(FROMMAIL);
  26. $this->Sendmail->To($userDetails['email']);
  27. //$this->Sendmail->Cc("sanjib@navsoft.in");
  28. $subject="XOIMAGES PASSWORD REQUEST";
  29. $this->Sendmail->Subject($subject);
  30. $this->Sendmail->layout='email';
  31. $this->Sendmail->view='mail_userpassword';
  32. $this->Sendmail->startup($this);
  33. $messageBody=$this->Sendmail->bodyText();
  34. $this->Sendmail->Body($messageBody); // set the body
  35. $this->Sendmail->Priority(1) ;
  36. $this->Sendmail->Send();
  37. $this->set('mailmsg','Your login information has been sent to your email.');
  38. #####
  39. }
  40. else {
  41. $this->set('mailmsg','Username is invalid. Please give A valid Username.');
  42. }
  43. }
  44. $this->render('validpasssending', 'ajax');
  45. }
  46. ################################################### PHOTOS SECTION #############################
  47. /*function indexnew(){
  48. $this->layout = 'xoindex';
  49. }*/
  50. function indexnew() {
  51. $this->layout = 'xoindex';
  52. $this->homepageslideInfo('Home');
  53. ################################################ Auction Invitation ################
  54. if(isset($_REQUEST['key'])&& $_REQUEST['key']!='') {
  55. $this->Session->write('auctKey',$_REQUEST['key']);
  56. if(isset($_REQUEST['act'])&& $_REQUEST['act']=='auctiondonorsinvite')
  57. $this->Session->write('auctType',$_REQUEST['act']);
  58. }
  59. ############################################ /Auction Invitation ################
  60. }
  61. function photos() {
  62. $this->layout = 'userphotoinner_home';
  63. $this->homepageslideInfo('Photos');
  64. }
  65. function customprofile($savimgpath=null) {
  66. $this->layout = 'profile_blank';
  67. $this->set("saveimagepath",$savimgpath);
  68. }
  69. function myalbum() {
  70. $this->checkSession();
  71. $this->layout = 'userphotoinner';
  72. $this->pageTitle = 'My Album';
  73. }
  74. function allalbum() {
  75. $this->layout = 'userphotoinner';
  76. $this->pageTitle = 'All Album';
  77. $select = " Select Xalbum.id,Xalbum.user_id,Xalbum.album_bg,Xalbum.album_access,Xalbum.album_name,Xuser.username";
  78. $from=" FROM user_albums Xalbum
  79. LEFT JOIN users Xuser ON Xalbum.user_id = Xuser.id
  80. LEFT JOIN user_details Xuserdetail ON Xalbum.user_id = Xuserdetail.user_id";
  81. $where="WHERE 1 AND Xalbum.album_access='public'";
  82. $others=" ";
  83. $others=" order by Xalbum.id desc";
  84. $PassParameter='';
  85. $fltr='';
  86. $CountField="Xalbum.id";
  87. $this->set("controller","users");
  88. $this->set("action","allalbum");
  89. $this->set("parameter",$PassParameter);
  90. $this->set("fltr",$fltr);
  91. $this->pagination($select,$from,$where,$others,$CountField,$this->params['url'],$PassParameter);
  92. if(isset($this->params['url']['Page'])) {
  93. $this->render("allalbum2","ajax");
  94. }
  95. }
  96. function photolisting() {
  97. $this->layout = 'userphotoinner';
  98. if(isset($_REQUEST['listtype']) && $_REQUEST['listtype']!='')
  99. $catlisttype = $_REQUEST['listtype'];
  100. else
  101. $catlisttype = '';
  102. ############################### Page Title & Head ############################
  103. $pageheadArr = array();
  104. $pageheadArr['featured'] = 'Featured';
  105. $pageheadArr['recent'] = 'Recent';
  106. $pageheadArr['mostvoted'] = 'Most Voted';
  107. $pageheadArr['mostcomment'] = 'Most Discussed';
  108. $pageheadArr['random'] = 'Random';
  109. $pageheadArr['favorite'] = 'Most Favorited ';
  110. $pageheadArr['tag'] = 'Tagged ';
  111. $pageheadArr['search'] = 'Search Result';
  112. $pageheadArr['mostviewed'] = 'Most Viewed';
  113. $pageheadArr['albumview'] = 'Album';
  114. if (array_key_exists($catlisttype, $pageheadArr)) {
  115. if($catlisttype=='albumview') {
  116. /* Album Name*/
  117. $albumNameSql = "Select IFNULL(album_name,'') as albumName from user_albums where id='".base64_decode($_REQUEST['albumid'])."'";
  118. $albumNameSql_res = mysql_fetch_array(mysql_query($albumNameSql));
  119. $albumName = stripslashes($albumNameSql_res['albumName']) ;
  120. /**/
  121. $this->pageTitle = $pageheadArr[$catlisttype]. $albumName.' Photos';
  122. $this->set('pagehead',$pageheadArr[$catlisttype].' : '. $albumName. ' Photos');
  123. }
  124. else {
  125. if($catlisttype=='tag') {
  126. $this->pageTitle = $pageheadArr[$catlisttype].' Photos : '. substr($_REQUEST['sortby'],0,20);
  127. $this->set('pagehead',$pageheadArr[$catlisttype].' Photos : '.substr($_REQUEST['sortby'],0,20));
  128. }
  129. else {
  130. $this->pageTitle = $pageheadArr[$catlisttype].' Photos';
  131. $this->set('pagehead',$pageheadArr[$catlisttype].' Photos');
  132. }
  133. }
  134. }
  135. else {
  136. $this->pageTitle = 'Photos';
  137. $this->set('pagehead','Photos');
  138. }
  139. ############################### Page Title & Head ############################
  140. /* Pagination and PHOTO listing */
  141. $select = " Select X.id,X.user_id,X.pic_original_name,X.pic_title,X.pic_desc,Xuser.username ,COUNT(Xcomment.id) as photoreview , Xuserdetail.user_profile_img , IFNULL(ROUND(AVG(Xrating.vote),0),0) as photorat,Xalbum.album_name ,Xalbum.id as albumid ,COUNT(Xfavorite.id) as photofavored ,X.is_featured , X.creation";
  142. $from=" FROM user_photo_albums X
  143. LEFT JOIN user_albums Xalbum ON X.user_album_id = Xalbum.id
  144. LEFT JOIN comments Xcomment ON X.id = Xcomment.user_photo_albums_id
  145. LEFT JOIN users Xuser ON X.user_id = Xuser.id
  146. LEFT JOIN user_details Xuserdetail ON X.user_id = Xuserdetail.user_id
  147. LEFT JOIN user_voting_images Xrating ON X.id = Xrating.image_id
  148. LEFT JOIN user_favorite_photo Xfavorite ON X.id=Xfavorite.favorite_photo_id ";
  149. $where="WHERE 1 AND X.is_blocked='0' AND X.is_temp='0' AND Xalbum.album_access='public'";
  150. if($catlisttype=='featured')
  151. $where.=" AND X.is_featured='1' ";
  152. if( $catlisttype=='albumview' && isset($_REQUEST['albumid']) && base64_decode($_REQUEST['albumid'])>0)
  153. $where.=" AND X.user_album_id='".base64_decode($_REQUEST['albumid'])."' ";
  154. if($catlisttype=='tag')
  155. $where.=" AND X.id IN (Select user_photo_album_id from user_photo_albums_tags where tagname Like '%".$_REQUEST['sortby']."%')";
  156. if($catlisttype=='search')
  157. $where.=" AND X.pic_title LIKE '%".$_REQUEST['srchtxt']."%' OR X.id IN (Select user_photo_album_id from user_photo_albums_tags where tagname Like '%".$_REQUEST['srchtxt']."%') ";
  158. $others=" group by X.id order by X.id desc ";
  159. if($catlisttype=='mostvoted')
  160. $others .=" ,photorat desc ";
  161. if($catlisttype=='mostcomment')
  162. $others .=" ,photoreview desc ";
  163. if($catlisttype=='mostviewed')
  164. $others .=" ,X.viewed desc ";
  165. if($catlisttype=='random')
  166. $others .=" , rand()";
  167. if($catlisttype=='favorite')
  168. $others .=" ,photofavored desc ";
  169. if($catlisttype=='recent')
  170. $others.=" ";
  171. if(isset($_REQUEST['sortby']) && $_REQUEST['sortby']!='')
  172. $PassParameter="listtype=".$catlisttype."&sortby=".$_REQUEST['sortby'];
  173. else {
  174. if(isset($catlisttype) && $catlisttype=='albumview')
  175. $PassParameter="listtype=".$catlisttype."&albumid=".$_REQUEST['albumid'];
  176. else {
  177. if(isset($_REQUEST['srchtxt']) && $_REQUEST['srchtxt']!='')
  178. $PassParameter="listtype=".$catlisttype."&srchtxt=".$_REQUEST['srchtxt'];
  179. else
  180. $PassParameter="listtype=".$catlisttype;
  181. }
  182. }
  183. $fltr='';
  184. $CountField="X.id";
  185. $this->set("controller","users");
  186. $this->set("action","photolisting");
  187. $this->set("parameter",$PassParameter);
  188. $this->set("fltr",$fltr);
  189. $this->pagination($select,$from,$where,$others,$CountField,$this->params['url'],$PassParameter);
  190. if(isset($this->params['url']['Page']) || (isset($fltr) && $fltr!="") ) {
  191. $this->set('pagehead','Most Recent');
  192. $this->render("photolisting2","ajax");
  193. }
  194. /**/
  195. }
  196. function featuredphoto($catlisttype=null) {
  197. $this->layout = 'profile_blank';
  198. /* Pagination and PHOTO listing */
  199. $select = " Select X.id,X.user_id,X.pic_original_name,X.pic_title,X.pic_desc,Xuser.username ,COUNT(Xcomment.id) as photoreview , Xuserdetail.user_profile_img , IFNULL(ROUND(AVG(Xrating.vote),0),0) as photorat,Xalbum.album_name ,Xalbum.id as albumid ,COUNT(Xfavorite.id) as photofavored ,X.is_featured,X.creation ";
  200. $from=" FROM user_photo_albums X
  201. LEFT JOIN user_albums Xalbum ON X.user_album_id = Xalbum.id
  202. LEFT JOIN comments Xcomment ON X.id = Xcomment.user_photo_albums_id
  203. LEFT JOIN users Xuser ON X.user_id = Xuser.id
  204. LEFT JOIN user_details Xuserdetail ON X.user_id = Xuserdetail.user_id
  205. LEFT JOIN user_voting_images Xrating ON X.id = Xrating.image_id
  206. LEFT JOIN user_favorite_photo Xfavorite ON X.id=Xfavorite.favorite_photo_id ";
  207. $where="WHERE 1 AND X.is_blocked='0' AND X.is_temp='0' AND Xalbum.album_access='public'";
  208. $moreUrl = $this->webroot.'users/photolisting?listtype=recent';
  209. if($catlisttype=='featured') {
  210. $where.=" AND X.is_featured='1' ";
  211. $moreUrl = $this->webroot.'users/photolisting?listtype=featured';
  212. }
  213. $others=" group by X.id ";
  214. if($catlisttype=='mostvoted') {
  215. $others .=" order by photorat desc ";
  216. $moreUrl = $this->webroot.'users/photolisting?listtype=mostvoted';
  217. }
  218. if($catlisttype=='')
  219. $others.=" order by X.id desc";
  220. $photoquery = mysql_query($select .$from .$where.$others .' LIMIT 12');
  221. $this->set('query',$photoquery) ;
  222. $this->set('morelink',$moreUrl) ;
  223. }
  224. function pagination($select,$from,$where,$others,$CountField,$arg,$PassParameter) {
  225. if(isset($arg['Page']))
  226. $pageFlag=$arg['Page'];
  227. $this->set("PassParameter",$PassParameter);
  228. $SetUserNumberOfVpsPerPage=SHOW_REC; /* Defined in config->paths.php*/
  229. $this->set("BackgroundClass",'pagination');
  230. $this->set("SelectedPage",'pagination_over');
  231. $this->set("Linkpage",'pagination_over');
  232. $this->set("FirstImage",'fdd.gif');
  233. $this->set("PreviousImage",'previous.gif');
  234. $this->set("NextImage",'next.gif');
  235. $this->set("LastImage",'rewd.gif');
  236. $UserNumberOfVpsPerPage=SHOW_REC; /* Defined in config->paths.php*/
  237. if(!is_numeric($UserNumberOfVpsPerPage)|| (intval($UserNumberOfVpsPerPage)!=$UserNumberOfVpsPerPage)||($UserNumberOfVpsPerPage<=0))
  238. $UserNumberOfVpsPerPage = $SetUserNumberOfVpsPerPage;
  239. if(!isset($arg['Page'])) $arg['Page']=1;
  240. if(!isset($arg['Offset'])) $arg['Offset']=0;
  241. ///echo "$select $from $where $others" ;
  242. $Query_ForNumber_Records=mysql_query("$select $from $where $others") or die('Line no 120' . mysql_error());
  243. //$Result_Query_ForNumber_Records=mysql_fetch_object($Query_ForNumber_Records);
  244. //$NoOfVps=$Result_Query_ForNumber_Records->NoOfVps;
  245. $NoOfVps=mysql_num_rows($Query_ForNumber_Records);
  246. $NumberOfVpsPerPage=$UserNumberOfVpsPerPage;
  247. $NoOfPages=ceil($NoOfVps/$NumberOfVpsPerPage); //3
  248. if($arg['Offset']==$NoOfVps) {
  249. if(isset($Offset)) {
  250. $Offset=$Offset-$NumberOfVpsPerPage;
  251. $Page--;
  252. if($Offset<0) {
  253. $Offset=0;
  254. $Page=1;
  255. }
  256. }else {
  257. $Offset=0;
  258. $Page=1;
  259. }
  260. }
  261. $this->set("Page",$arg['Page']);
  262. $this->set("Offset",$arg['Offset']);
  263. $this->set("NumberOfVpsPerPage",$NumberOfVpsPerPage);
  264. $this->set("NoOfPages",$NoOfPages);
  265. $this->set("UserNumberOfVpsPerPage",$UserNumberOfVpsPerPage);
  266. //print "$select $from $where $others";
  267. $this->set("qryOthr","$select $from $where");
  268. //echo "$select $from $where $others LIMIT ".$arg['Offset'].",$NumberOfVpsPerPage";
  269. $SelectRecord = mysql_query("$select $from $where $others LIMIT ".$arg['Offset'].",$NumberOfVpsPerPage") or die('Line no '.__LINE__ . mysql_error());
  270. $this->set("query",$SelectRecord);
  271. }
  272. ################################################### PHOTOS SECTION #############################
  273. function aboutus() {
  274. $this->layout = 'default';
  275. ########### data from table ######
  276. $contectsql = "Select description from site_managements where id='1'";
  277. $contectsql_res = mysql_query($contectsql);
  278. $contectsql_arr = mysql_fetch_array($contectsql_res);
  279. $this->set('content',$contectsql_arr['description']);
  280. ######
  281. }
  282. function contactus($windowType=null) {
  283. $this->layout = 'default';
  284. ########### data from table ######
  285. $contectsql = "Select description from site_managements where id='2'";
  286. $contectsql_res = mysql_query($contectsql);
  287. $contectsql_arr = mysql_fetch_array($contectsql_res);
  288. $this->set('content',$contectsql_arr['description']);
  289. if($windowType)
  290. $this->set('windowcontent',$windowType);
  291. else
  292. $this->set('windowcontent','feedback');
  293. ######
  294. }
  295. function contactusajax($pageaction=null) {
  296. echo $pageaction;
  297. $this->set('pagecontentText',$pageaction);
  298. $this->render('contactusajax', 'ajax');
  299. }
  300. function terms() {
  301. $this->layout = 'default';
  302. ########### data from table ######
  303. $contectsql = "Select description from site_managements where id='3'";
  304. $contectsql_res = mysql_query($contectsql);
  305. $contectsql_arr = mysql_fetch_array($contectsql_res);
  306. $this->set('content',$contectsql_arr['description']);
  307. ######
  308. }
  309. function privacy() {
  310. $this->layout = 'default';
  311. ########### data from table ######
  312. $contectsql = "Select description from site_managements where id='4'";
  313. $contectsql_res = mysql_query($contectsql);
  314. $contectsql_arr = mysql_fetch_array($contectsql_res);
  315. $this->set('content',$contectsql_arr['description']);
  316. ######
  317. }
  318. function disclaimer() {
  319. $this->layout = 'default';
  320. ########### data from table ######
  321. $contectsql = "Select description from site_managements where id='5'";
  322. $contectsql_res = mysql_query($contectsql);
  323. $contectsql_arr = mysql_fetch_array($contectsql_res);
  324. $this->set('content',$contectsql_arr['description']);
  325. ######
  326. }
  327. function parents() {
  328. $this->layout = 'default';
  329. ########### data from table ######
  330. $contectsql = "Select description from site_managements where id='7'";
  331. $contectsql_res = mysql_query($contectsql);
  332. $contectsql_arr = mysql_fetch_array($contectsql_res);
  333. $this->set('content',$contectsql_arr['description']);
  334. ######
  335. }
  336. function home() {
  337. $this->layout = 'default';
  338. $this->pageTitle = 'Home';
  339. $this->pageTitle = 'User Login';
  340. if(isset($_SESSION['UserId']) && $_SESSION['UserId']!="") {
  341. $tempid = time();
  342. $tempsessid = session_id();
  343. $this->set('loggedUid',base64_encode($_SESSION['UserId']));
  344. $this->set('loggedId',$tempid);
  345. $this->set('loggedsid',$tempsessid);
  346. }
  347. }
  348. function login() {
  349. $this->layout = 'default';
  350. $this->pageTitle = 'User Login';
  351. if(!empty($this->data)) {
  352. $this->data['User']['username']=trim($this->data['User']['userLoginName']);
  353. $this->data['User']['password']=base64_encode(trim($this->data['User']['userLoginPass']));
  354. $someone = $this->User->findByUsername($this->data['User']['username']);
  355. $hRef = $_SERVER['HTTP_REFERER'];
  356. $this->Session->write('href', $hRef);
  357. if(!empty($someone['User']['password']) && $someone['User']['password'] == $this->data['User']['password'] && $someone['User']['user_status']==1) {
  358. if($someone['User']['user_status']==1) {
  359. $this->Session->write('User', $someone['User']['username']);
  360. $this->Session->write('UserId', $someone['User']['id']);
  361. $this->Session->write('GrpId', $someone['User']['user_group_master_id']);
  362. $userdetail = $this->getUserDetails($someone['User']['id']);
  363. $this->Session->write('PrjUserCityId', $userdetail['city']);
  364. $this->Session->write('PrjUserStateId', $userdetail['state']);
  365. $this->Session->write('PrjUserCountryId', $userdetail['c_id']);
  366. unset($_SESSION['PrjUserCityName']);
  367. unset($_SESSION['PrjUserStateName']);
  368. unset($_SESSION['PrjUserCountryName']);
  369. unset($_SESSION['PrjUserLocation']);
  370. ########################## AUCTION INVITATION OPERATION #######
  371. if(isset($_SESSION['auctKey']))
  372. $this->auctInviteoperation() ;
  373. ############################# /AUCTION INVITATION OPERATION #######
  374. if(isset($_REQUEST['act_event']) && $_REQUEST['act_event'] != "") {
  375. $link = 'calendars/acceptinvitation?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evtid'].'&invitation='.$_REQUEST['invitation'];
  376. $this->redirect($link);
  377. }
  378. else if(isset($_REQUEST['act']) && $_REQUEST['act'] == "activityinvite") {
  379. $link = 'calendars/showactivity?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evtid'].'&invitation='.base64_decode($_REQUEST['invitation']);
  380. $this->redirect($link);
  381. }
  382. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "sharecal") {
  383. $qry = "insert into calendar_import values(".base64_decode($_REQUEST['calid']).", ".$someone['User']['id'].", 'y')";
  384. $res = mysql_query($qry);
  385. $link = 'users/user_home?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.base64_encode(1);
  386. //$this->redirect($link);
  387. $this->redirect('tickets/index');
  388. }
  389. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "eventinvite") {
  390. $link = 'calendars/acceptinvitation?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evidVal'].'&invitation='.$_REQUEST['invitationVal'];
  391. $this->redirect($link);
  392. }
  393. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "activityinvite") {
  394. $link = 'calendars/showactivity?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evidVal'].'&invitation='.$_REQUEST['invitationVal'];
  395. $this->redirect($link);
  396. }
  397. else {
  398. $this->flash('The username with id: '.$this->data['User']['username'].' has been submitted.', '/users');
  399. $link = 'users/user_home?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.base64_encode(1);
  400. //$this->redirect($link);
  401. $this->redirect('tickets/index');
  402. }
  403. }
  404. else {
  405. $msg = "Invalid Login";
  406. $this->redirect('/users/signup?msg=error');
  407. }
  408. }
  409. else {
  410. $msg = "Invalid Login";
  411. $this->redirect('/users/signup?msg=error');
  412. }
  413. }
  414. }
  415. function headerlogin() {
  416. $this->layout = 'default';
  417. $this->pageTitle = 'User Login';
  418. if(empty($this->data)){
  419. $userarr = array('headerLoginName'=>'','headerLoginPass'=>'');
  420. if(isset($_POST['headerLoginName']))
  421. $userarr['headerLoginName'] = $_POST['headerLoginName'];
  422. if(isset($_POST['headerLoginPass']))
  423. $userarr['headerLoginPass'] = $_POST['headerLoginPass'];
  424. $this->data = array('User'=>$userarr);
  425. }
  426. if(!empty($this->data)) {
  427. $this->data['User']['username']=trim($this->data['User']['headerLoginName']);
  428. $this->data['User']['password']=base64_encode(trim($this->data['User']['headerLoginPass']));
  429. $someone = $this->User->findByUsername($this->data['User']['username']);//"http://adserver:8088/xoimage-115-07/Nnew/"
  430. $hRef = $_SERVER['HTTP_REFERER'];
  431. $this->Session->write('href', $hRef);
  432. if(!empty($someone['User']['password']) && $someone['User']['password'] == $this->data['User']['password'] && $someone['User']['user_status']==1) {
  433. if($someone['User']['user_status']==1) {
  434. mysql_query("DELETE FROM xoevent_cart WHERE xoevent_pay_status='0' AND user_id='".$someone['User']['id']."' AND xoevent_sessionid!='".session_id()."'") or die(mysql_error());
  435. $userdetail = $this->getUserDetails($someone['User']['id']);
  436. $this->Session->write('User', $someone['User']['username']);
  437. $this->Session->write('UserId', $someone['User']['id']);
  438. $this->Session->write('GrpId', $someone['User']['user_group_master_id']);
  439. $this->Session->write('PrjUserCityId', $userdetail['city']);
  440. $this->Session->write('PrjUserStateId', $userdetail['state']);
  441. $this->Session->write('PrjUserCountryId', $userdetail['c_id']);
  442. unset($_SESSION['PrjUserCityName']);
  443. unset($_SESSION['PrjUserStateName']);
  444. unset($_SESSION['PrjUserCountryName']);
  445. unset($_SESSION['PrjUserLocation']);
  446. ##################### FORUM SESSION START
  447. /* $ch = curl_init();
  448. $scriptUrl = DOMAIN. 'phpbbcakelogin.php?userName='.$this->data['User']['username'].'&password='.$this->data['User']['password'];
  449. curl_setopt($ch, CURLOPT_URL, $scriptUrl);
  450. curl_setopt($ch, CURLOPT_HEADER, 0);
  451. $output =curl_exec($ch);
  452. curl_close($ch);
  453. echo $output ;/**/
  454. //$this->Cakephpbb->phpbbuserlogged($this->data['User']['username'],$this->data['User']['password']);*/
  455. ##################### FORUM SESSION START
  456. if($someone['User']['user_group_master_id']==2) {
  457. //echo "group id : 2";
  458. $_SESSION['pubSchool']='p';
  459. $_SESSION['is_public']=1;
  460. $_SESSION['categoryTab']=2;
  461. }
  462. if($someone['User']['user_group_master_id']==3) {
  463. //echo "group id : 3";
  464. $_SESSION['pubSchool']='s';
  465. $_SESSION['is_public']=2;
  466. $_SESSION['categoryTab']=3;
  467. }
  468. if(isset($_POST['redirectaction'])){
  469. $this->Session->write('cart_id',$_POST['cart_id']);
  470. $this->Session->write('ticket_id',$_POST['ticket_id']);
  471. $this->redirect('tickets/addtocart');
  472. return;
  473. }
  474. ########################## AUCTION INVITATION OPERATION #######
  475. if(isset($_SESSION['auctKey']))
  476. $this->auctInviteoperation() ;
  477. ############################# /AUCTION INVITATION OPERATION #######
  478. if(isset($_REQUEST['act']) && $_REQUEST['act'] == "activityinvite") {
  479. $link = 'calendars/showactivity?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evtid'].'&invitation='.base64_decode($_REQUEST['invitation']);
  480. $this->redirect($link);
  481. }
  482. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "sharecal") {
  483. $qry = "insert into calendar_import values(".base64_decode($_REQUEST['calid']).", ".$someone['User']['id'].", 'y')";
  484. $res = mysql_query($qry);
  485. $link = 'users/user_home?id='.time().'&uid='.base64_encode($someone['User']['id']);
  486. $this->redirect('tickets/index');
  487. //$this->redirect($link);
  488. }
  489. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "eventinvite") {
  490. $link = 'calendars/acceptinvitation?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evidVal'].'&invitation='.$_REQUEST['invitationVal'];
  491. $this->redirect($link);
  492. }
  493. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "activityinvite") {
  494. $link = 'calendars/showactivity?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evidVal'].'&invitation='.$_REQUEST['invitationVal'];
  495. $this->redirect($link);
  496. }
  497. else {
  498. $this->flash('The username with id: '.$this->data['User']['username'].' has been submitted.', '/users');
  499. $link = 'users/user_home?id='.time().'&uid='.base64_encode($someone['User']['id']);
  500. $this->redirect('tickets/index');
  501. //$this->redirect($link);
  502. }
  503. }
  504. }
  505. else {
  506. $msg = "Invalid Login";
  507. $this->redirect('/?msg=headererror');
  508. }
  509. }
  510. }
  511. ############## FOR POPUPLOGIN ######
  512. function checkpopuplogin() {
  513. if(!empty($this->data)) {
  514. $this->data['User']['username']=trim($this->data['User']['headerLoginName']);
  515. $this->data['User']['password']=base64_encode(trim($this->data['User']['headerLoginPass']));
  516. $someone = $this->User->findByUsername($this->data['User']['username']);//"http://adserver:8088/xoimage-115-07/Nnew/"
  517. if(!empty($someone['User']['password']) && $someone['User']['password'] == $this->data['User']['password']) {
  518. if($someone['User']['user_status']==1) {
  519. mysql_query("DELETE FROM xoevent_cart WHERE xoevent_pay_status='0' AND user_id='".$someone['User']['id']."' AND xoevent_sessionid!='".session_id()."'") or die(mysql_error());
  520. $this->Session->write('User', $someone['User']['username']);
  521. $this->Session->write('UserId', $someone['User']['id']);
  522. $this->Session->write('GrpId', $someone['User']['user_group_master_id']);
  523. $userdetail = $this->getUserDetails($someone['User']['id']);
  524. $this->Session->write('PrjUserCityId', $userdetail['city']);
  525. $this->Session->write('PrjUserStateId', $userdetail['state']);
  526. $this->Session->write('PrjUserCountryId', $userdetail['c_id']);
  527. unset($_SESSION['PrjUserCityName']);
  528. unset($_SESSION['PrjUserStateName']);
  529. unset($_SESSION['PrjUserCountryName']);
  530. unset($_SESSION['PrjUserLocation']);
  531. if($someone['User']['user_group_master_id']==2) {
  532. $_SESSION['pubSchool']='p';
  533. $_SESSION['is_public']=1;
  534. $_SESSION['categoryTab']=2;
  535. }
  536. if($someone['User']['user_group_master_id']==3) {
  537. $_SESSION['pubSchool']='s';
  538. $_SESSION['is_public']=2;
  539. $_SESSION['categoryTab']=3;
  540. }
  541. $link = 'users/user_home?id='.time().'&uid='.base64_encode($someone['User']['id']);
  542. $this->set("validated",0); ///right Info
  543. $this->set('userHome',$link);
  544. }
  545. }
  546. else {
  547. $this->set("validated",1); /// Error Info
  548. }
  549. }
  550. $this->render('validpopuplogin', 'ajax');
  551. }
  552. ############## FOR POPUPLOGIN ######
  553. function auctInviteoperation() {
  554. $this->checkSession();
  555. if(isset($_SESSION['auctKey'])) {
  556. $updatesql = "UPDATE auctxon_donors_invite SET is_respond='1' , registered_invitee_userid='".$_SESSION['UserId']."' where is_respond='0' and hash_key='".$_SESSION['auctKey']."' ";
  557. @mysql_query($updatesql);
  558. }
  559. }
  560. function signup() {
  561. if(isset($_SESSION['UserId'])) {
  562. $this->redirect('/?id=1');
  563. }
  564. $group=base64_decode($_REQUEST['gr']);
  565. $this->set('group',$group);
  566. ################################################ Auction Invitation ################
  567. if(isset($_REQUEST['key'])&& $_REQUEST['key']!='') {
  568. $this->Session->write('auctKey',$_REQUEST['key']);
  569. if(isset($_REQUEST['act'])&& $_REQUEST['act']=='auctiondonorsinvite')
  570. $this->Session->write('auctType',$_REQUEST['act']);
  571. }
  572. ############################################ /Auction Invitation ################
  573. $this->layout = 'user_signup';
  574. $this->pageTitle = 'Xoimage Sign-up';
  575. if (!empty($this->data)) {
  576. if(isset($_REQUEST['userType']) && $_REQUEST['userType']!="") {
  577. $this->data['User']['user_group_master_id'] = $_REQUEST['userType'];
  578. //die();
  579. }
  580. $this->data['User']['user_status'] = 1;
  581. $this->data['User']['password'] = base64_encode($this->data['User']['password']);
  582. if ($this->User->save($this->data)) {
  583. $id = mysql_insert_id();
  584. $fname = addslashes(strtolower($this->data['User']['first_name']));
  585. $lname = addslashes(strtolower($this->data['User']['last_name']));
  586. $email = $this->data['User']['email'];
  587. $user_name = trim($this->data['User']['username']) ;
  588. $pass=base64_encode(trim($this->data['User']['password']));
  589. ################ FORUM INTEGRATION
  590. $pass=$this->data['User']['password'];
  591. $email_hash=crc32($email);
  592. $sql1="INSERT INTO phpbb_users (username, username_clean, user_password, user_pass_convert, user_email, user_email_hash, group_id, user_type, user_permissions, user_timezone, user_dateformat, user_lang, user_style, user_allow_pm, user_actkey, user_ip, user_regdate, user_passchg, user_options, user_inactive_reason, user_inactive_time, user_lastmark, user_lastvisit, user_lastpost_time, user_lastpage, user_posts, user_dst, user_colour, user_occ, user_interests, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_message_rules, user_full_folder, user_emailtime, user_notify, user_notify_pm, user_notify_type, user_allow_viewonline, user_allow_viewemail, user_allow_massemail, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_form_salt) VALUES ('$user_name', '$user_name', '$pass', 0, '$email', '$email_hash', 2, 0, '', 0, 'D M d, Y g:i a', 'en', '1', 1, '', '0.0.0.0', 1202106072, 1202106072, 895, 0, 0, 1202106072, 0, 0, '', 0, '0', '', '', '', '', 0, 0, 0, 0, 0, 0, 0, -3, 0, 0, 1, 0, 1, 1, 1, '', '', '', '39390ba638fe9a78')";
  593. //echo $sql1;
  594. @mysql_query($sql1);
  595. $new_query_group="select MAX(user_id) AS USERID FROM phpbb_users";
  596. $new_result_group=mysql_query($new_query_group);
  597. $new_data_group=mysql_fetch_array($new_result_group);
  598. $new_user_id=$new_data_group['USERID'];
  599. //echo $new_user_id;
  600. $new_query_insert="INSERT INTO phpbb_user_group (group_id,user_id,group_leader,user_pending) VALUES ('2','$new_user_id','0','0')";
  601. @mysql_query($new_query_insert);
  602. ################ FORUM INTEGRATION
  603. if(isset($_REQUEST['userFrndId'])) {
  604. $group = $_REQUEST['userType'];
  605. $frnd_id = base64_decode($_REQUEST['userFrndId']);
  606. $noOfFrndUsr = mysql_num_rows(mysql_query("select * from user_friends where user_id=".$id));
  607. $noFrnd = mysql_num_rows(mysql_query("select * from user_friends where user_id=".$frnd_id));
  608. $frnd_qry = mysql_query("INSERT INTO `user_friends` ( `id` , `user_id`,`friend_id`, `status` )VALUES ('',".$id.",".$frnd_id.",".($noOfFrndUsr+1).")") ;
  609. $frnd_qry = mysql_query("INSERT INTO `user_friends` ( `id` , `user_id`,`friend_id`, `status` )VALUES ('',".$frnd_id.",".$id.",".($noFrnd+1).")") ;
  610. }
  611. else
  612. $group = $this->data['User']['group_id'];
  613. $dob = $_REQUEST['year']."-".$_REQUEST['mon']."-".$_REQUEST['dob'];
  614. $gender=$_REQUEST['sex'];
  615. $city=$_REQUEST['city'];
  616. $state=$_REQUEST['province'];
  617. $country=$_REQUEST['country'];
  618. $qry = "INSERT INTO `user_details` ( `id` , `user_id`, `first_name`, `last_name`, `email`, `dob`,gender,city,state,c_id)VALUES ('',".$id.",'".$fname."','".$lname."','".$email."', '".$dob."','".$gender."','".$city."','".$state."','".$country."')" ;
  619. if($res = mysql_query($qry)) {
  620. $this->Session->write('User', $this->data['User']['username']);
  621. $this->Session->write('UserId', $id);
  622. $this->Session->write('GrpId', $this->data['User']['user_group_master_id']);
  623. //$this->flash('User has been saved.','/users');
  624. ########################## AUCTION INVITATION OPERATION #######
  625. if(isset($_SESSION['auctKey']))
  626. $this->auctInviteoperation() ;
  627. ############################# /AUCTION INVITATION OPERATION #######
  628. $this->sendVerifyemail();
  629. $this->redirect('/users/congratulations?id='.time().'&uid='.base64_encode($id).'&sessid='.session_id());
  630. }
  631. else {
  632. $id = mysql_insert_id();
  633. $this->Session->write('User', $this->data['User']['username']);
  634. $this->Session->write('UserId', $id);
  635. }
  636. if(isset($_REQUEST['act_event']) && $_REQUEST['act_event'] != "") {
  637. //echo $_REQUEST['act_event'].", ".$_REQUEST['evtid'].", ".$_REQUEST['invitation'];
  638. $link = 'calendars/acceptinvitation?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evtid'].'&invitation='.$_REQUEST['invitation'];
  639. $this->redirect($link);
  640. }
  641. else if(isset($_REQUEST['act']) && $_REQUEST['act'] == "activityinvite") {
  642. $link = 'calendars/showactivity?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evtid'].'&invitation='.$_REQUEST['invitation'];
  643. $this->redirect($link);
  644. }
  645. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "sharecal") {
  646. $checkCalIm = mysql_num_rows(mysql_query("select * from calendar_import where importer_id=".$someone['User']['id']." and import_cal_id=".base64_decode($_REQUEST['calid'])));
  647. if($checkCalIm<1) {
  648. $qry = "insert into calendar_import values(".base64_decode($_REQUEST['calid']).", ".$someone['User']['id'].", 'y')";
  649. $res = mysql_query($qry);
  650. }
  651. $link = 'users/user_home?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.base64_encode(1);
  652. //$this->redirect($link);
  653. $this->redirect("tickets/index");
  654. }
  655. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "eventinvite") {
  656. $link = 'calendars/acceptinvitation?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evidVal'].'&invitation='.$_REQUEST['invitationVal'];
  657. $this->redirect($link);
  658. }
  659. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "activityinvite") {
  660. $link = 'calendars/showactivity?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evidVal'].'&invitation='.$_REQUEST['invitationVal'];
  661. $this->redirect($link);
  662. }
  663. else {
  664. //$this->sendVerifyemail();
  665. $this->flash('The username with id: '.$this->data['User']['username'].' has been submitted.', '/users');
  666. $this->redirect('/users/congratulations?id='.time().'&uid='.base64_encode($id).'&sessid='.session_id());
  667. }
  668. }
  669. }
  670. $currentuser = array('topleft'=>'event-photo-tab-top-left.gif','topmiddle'=>'eventphoto-tab_topmidsml','topright'=>'event-photo-tab-top-right.gif','midleft'=>'eventphoto-tab_leftmid','midbgcolur'=>'fafeff','midright'=>'eventphoto-tab_rightmid','bottomleft'=>'event-photo-tab-bottom-left.gif','bottommid'=>'eventphoto-tab_botmid','bottomright'=>'event-photo-tab-bottom-right.gif') ;
  671. if(isset($_REQUEST['gr']) && base64_decode($_REQUEST['gr'])==2)
  672. $currentuser = array('topleft'=>'sponsor-tab-top-left.gif','topmiddle'=>'sponsor-tab_topmidsml','topright'=>'sponsor-tab-top-right.gif','midleft'=>'sponsor-tab_leftmid','midbgcolur'=>'fff6f6','midright'=>'sponsor-tab_rightmid','bottomleft'=>'sponsor-tab-bottom-left.gif','bottommid'=>'sponsor-tab_botmid','bottomright'=>'sponsor-tab-bottom-right.gif') ;
  673. if(isset($_REQUEST['gr']) && base64_decode($_REQUEST['gr'])==3)
  674. $currentuser = array('topleft'=>'tickets-tab-top-left.gif','topmiddle'=>'ticket-tab_topmidsml','topright'=>'tickets-tab-top-right.gif','midleft'=>'ticket-tab_leftmid','midbgcolur'=>'fdfff4','midright'=>'ticket-tab_rightmid','bottomleft'=>'tickets-tab-bottom-left.gif','bottommid'=>'ticket-tab_botmid','bottomright'=>'tickets-tab-bottom-right.gif') ;
  675. $this->set('currentStyle', $currentuser);
  676. }
  677. ################################## USERS PROFILE PAGE #####################
  678. function myprofile($userid=null) {
  679. $this->pageTitle = 'Profile';
  680. $this->layout = 'default';
  681. $this->checkSession();
  682. $userid = $_REQUEST['uid'];
  683. if($userid)
  684. $uid = base64_decode($userid);
  685. else
  686. $uid = $_SESSION['UserId'];
  687. $this->set('userprofileId',$uid) ;
  688. $this->data = $this->User->UserDetails->findByUserId($uid);
  689. $this->set('profiledetail',$this->data);
  690. }
  691. function social() {
  692. $this->layout = 'profile_blank';
  693. }
  694. function professional() {
  695. $this->layout = 'profile_blank';
  696. }
  697. function personalinfo() {
  698. $this->layout = 'profile_blank';
  699. }
  700. ###########################################################################
  701. function user_home() {
  702. $this->pageTitle = 'User Home';
  703. //$this->checkSession();
  704. $this->layout = 'userprofilevisit';
  705. $this->userProfileLeftPanel();
  706. $profilehomelink = $this->webroot."users/user_home?id=".time()."&uid=".base64_encode($this->profileUserIdforQry)."&sessid=".session_id()."";
  707. $this->set('profilehomelink',$profilehomelink);
  708. //$someone = $this->User->findById($_SESSION['UserId']);
  709. ##################### Insert the recored for profile allingment #########
  710. if(isset($_SESSION['UserId'])) {
  711. $liitem=array('firstlist_1','firstlist_2','firstlist_3','firstlist_4','firstlist_5','firstlist_8','firstlist_9');
  712. $liitem2=array('secondlist_1','secondlist_2','secondlist_3','secondlist_4','secondlist_5','secondlist_6');
  713. if($_SESSION['GrpId']==2) /// Photographer
  714. array_push($liitem,'firstlist_6');
  715. if($_SESSION['GrpId']==3) /// Organisation
  716. array_push($liitem,'firstlist_7');
  717. $stleftpos=1;
  718. $strightpos=1;
  719. $maxLeftposition = "SELECT MAX(boxorder) as leftpos from profilemap where userid='".$_SESSION['UserId']."' and position='left'" ;
  720. $maxLeftposition_res = mysql_query($maxLeftposition);
  721. if(mysql_num_rows($maxLeftposition_res)>0) {
  722. $maxLeftposition_arr =mysql_fetch_array($maxLeftposition_res);
  723. $stleftpos = $maxLeftposition_arr['leftpos'];
  724. }
  725. $maxLeftposition = "SELECT MAX(boxorder) as rightpos from profilemap where userid='".$_SESSION['UserId']."' and position='right'" ;
  726. $maxLeftposition_res = mysql_query($maxLeftposition);
  727. if(mysql_num_rows($maxLeftposition_res)>0) {
  728. $maxLeftposition_arr =mysql_fetch_array($maxLeftposition_res);
  729. $strightpos = $maxLeftposition_arr['rightpos'];
  730. }
  731. foreach($liitem as $liitem_item=>$liitem_value) {
  732. $profilesql = "SELECT * from profilemap where boxname='".$liitem_value."' and userid='".$_SESSION['UserId']."'";
  733. $profilesql_res = mysql_query($profilesql);
  734. if(mysql_num_rows($profilesql_res)==0) {
  735. $stleftpos++;
  736. $insertleftinfo = "INSERT INTO profilemap SET boxname='".$liitem_value."' ,userid='".$_SESSION['UserId']."',display='block',position='left',boxorder='".$stleftpos."',boxid='".$stleftpos."' ";
  737. mysql_query($insertleftinfo);
  738. }
  739. }
  740. foreach($liitem2 as $liitem_item=>$liitem_value) {
  741. $profilesql = "SELECT * from profilemap where boxname='".$liitem_value."' and userid='".$_SESSION['UserId']."'";
  742. $profilesql_res = mysql_query($profilesql);
  743. if(mysql_num_rows($profilesql_res)==0) {
  744. $strightpos++;
  745. $insertleftinfo = "INSERT INTO profilemap SET boxname='".$liitem_value."' ,userid='".$_SESSION['UserId']."',display='block',position='right',boxorder='".$strightpos."',boxid='".$strightpos."' ";
  746. mysql_query($insertleftinfo);
  747. }
  748. }
  749. ##################### Insert the recored for profile allingment #########
  750. }
  751. if(isset($_REQUEST['uid'])) {
  752. $uid = base64_decode($_REQUEST['uid']);
  753. $mail = mysql_query("select * from emails where user_id=".$uid." and inbox_status='unread'");
  754. if($mail) {
  755. $mailQry = mysql_num_rows($mail);
  756. $this->set('mails', $mailQry);
  757. }
  758. if(empty($this->data)) {
  759. $this->data = $this->User->UserDetails->read(null, $uid);
  760. $this->set('user_det',$this->data);
  761. }
  762. }
  763. else {
  764. $this->redirect('../index');
  765. }
  766. $this->createStuffArray();
  767. $this->getMyComments($this->PROFILE_USER_ID);
  768. }
  769. function postcomment() {
  770. mysql_query("INSERT INTO user_comments(user_id,friend_id,comment) VALUES('".$this->params['form']['profileid']."','".$_SESSION['UserId']."','".mysql_escape_string($this->params['form']['comment'])."')");
  771. $this->getMyComments($this->params['form']['profileid']);
  772. $this->render("usercomment","ajax");
  773. }
  774. function congratulations() {
  775. $this->checkSession(1);
  776. $this->pageTitle = 'Invite Friend';
  777. $this->layout = 'userloggedin';
  778. $someone = $this->User->findById($_SESSION['UserId']);
  779. $this->set('firstname',$someone['UserDetails']['first_name']);
  780. $this->set('lasttname',$someone['UserDetails']['last_name']);
  781. /*if(empty($this->data))
  782. {
  783. $this->data = $this->User->read(null, $id);
  784. $this->set('data',$this->data);
  785. }*/
  786. }
  787. function logout() {
  788. //$this->layout = 'default';
  789. //$this->session->delete('Admin');
  790. //$this->session->delete('Admin_id');
  791. if(isset($_SESSION['UserId'])){
  792. $sql = "SELECT * FROM ticket_carts WHERE user_id='".$_SESSION['UserId']."' AND pay_status='0'";
  793. $result = mysql_query($sql);
  794. while($row = mysql_fetch_array($result)){
  795. //delete cart
  796. mysql_query("DELETE FROM ticket_cart_details WHERE cart_id='".$row['id']."'") or die(mysql_error());
  797. mysql_query("DELETE FROM ticket_seat_booked WHERE cart_id='".$row['id']."'") or die(mysql_error());
  798. mysql_query("DELETE FROM ticket_carts WHERE id='".$row['id']."'") or die(mysql_error());
  799. mysql_query("DELETE FROM transaction_ticket WHERE id='".$row['transaction_id']."'") or die(mysql_error());
  800. }
  801. }
  802. unset($_SESSION);
  803. $this->Session->destroy();
  804. $this->Session->destroy('User');
  805. $this->Session->destroy('UserId');
  806. $this->redirect('/');
  807. /*if(session_destroy())
  808. $this->redirect('users/home');
  809. else
  810. $this->flash('session destruction unsuccessfull.','/users/home');*/
  811. }
  812. function forgotPass() {
  813. $this->layout = 'default';
  814. echo $_REQUEST['msg'];
  815. $this->set('data',$_REQUEST['msg']);
  816. }
  817. function forgotPassword() {
  818. $this->render('forgotpassview', 'ajax');
  819. }
  820. function my_photo() {
  821. $this->checkSession();
  822. $this->layout = 'userloggedin';
  823. $this->pageTitle = 'My Photo';
  824. }
  825. function sendinvite() {
  826. $this->checkSession();
  827. $this->layout = 'userloggedin';
  828. $someone = $this->User->findById($_SESSION['UserId']);
  829. $this->set('invitedGrp',$someone['User']['user_group_master_id']);
  830. $this->set('inviterId',$someone['User']['id']);
  831. $FriendInviteUrl = "http://www.xoimages.com/users/signup?id=".time()."&gr=".base64_encode($someone['User']['user_group_master_id'])."&sessid=".session_id()."&task=invite&taskbyId=".base64_encode($someone['User']['id'])."";
  832. $this->set('inviteMailUrl','<a href="'.$FriendInviteUrl.'">Click Here</a>');
  833. }
  834. ####################### TESTING##########
  835. function userprofile()

Large files files are truncated, but you can click here to view the full file