Auguria_Sponsorship - Version 1.0.3

Version Notes

If you have ideas for improvements or find bugs, please send them to Franck Charpentier at www.auguria.net, with Auguria LastReviews as part of the subject line.

Download this release

Release Info

Developer Magento Core Team
Extension Auguria_Sponsorship
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

Files changed (239) hide show
  1. app/code/community/Auguria/Sponsorship/Block/Adminhtml/Link/Grid.php +2 -2
  2. app/code/community/Auguria/Sponsorship/Block/Openinviter.php +65 -0
  3. app/code/community/Auguria/Sponsorship/Block/Sponsorship.php +43 -8
  4. app/code/community/Auguria/Sponsorship/Helper/Mail.php +1 -0
  5. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/LICENSE.txt +277 -0
  6. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/POLICY.txt +158 -0
  7. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/autoupdate.php +211 -0
  8. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/_hosted.conf +1 -0
  9. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/abv.conf +1 -0
  10. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/aol.conf +1 -0
  11. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/apropo.conf +1 -0
  12. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/atlas.conf +1 -0
  13. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/aussiemail.conf +1 -0
  14. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/azet.conf +1 -0
  15. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/badoo.conf +1 -0
  16. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/bebo.conf +1 -0
  17. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/bigstring.conf +1 -0
  18. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/bookcrossing.conf +1 -0
  19. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/bordermail.conf +1 -0
  20. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/brazencareerist.conf +1 -0
  21. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/canoe.conf +1 -0
  22. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/care2.conf +1 -0
  23. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/clevergo.conf +1 -0
  24. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/cyworld.conf +1 -0
  25. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/doramail.conf +1 -0
  26. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/eons.conf +1 -0
  27. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/evite.conf +1 -0
  28. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/facebook.conf +1 -0
  29. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/faces.conf +1 -0
  30. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/famiva.conf +1 -0
  31. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/fastmail.conf +1 -0
  32. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/fdcareer.conf +1 -0
  33. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/flickr.conf +1 -0
  34. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/flingr.conf +1 -0
  35. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/flixster.conf +1 -0
  36. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/fm5.conf +1 -0
  37. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/freemail.conf +1 -0
  38. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/friendfeed.conf +1 -0
  39. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/friendster.conf +1 -0
  40. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/gawab.conf +1 -0
  41. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/gmail.conf +1 -0
  42. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/gmx_net.conf +1 -0
  43. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/graffiti.conf +1 -0
  44. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/hi5.conf +1 -0
  45. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/hotmail.conf +1 -0
  46. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/hushmail.conf +1 -0
  47. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/hyves.conf +1 -0
  48. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/inbox.conf +1 -0
  49. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/india.conf +1 -0
  50. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/indiatimes.conf +1 -0
  51. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/inet.conf +1 -0
  52. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/interia.conf +1 -0
  53. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/katamail.conf +1 -0
  54. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/kids.conf +1 -0
  55. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/kincafe.conf +1 -0
  56. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/konnects.conf +1 -0
  57. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/koolro.conf +1 -0
  58. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/lastfm.conf +1 -0
  59. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/libero.conf +1 -0
  60. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/linkedin.conf +1 -0
  61. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/livejournal.conf +1 -0
  62. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/lovento.conf +1 -0
  63. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/lycos.conf +1 -0
  64. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mail2world.conf +1 -0
  65. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mail_com.conf +1 -0
  66. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mail_in.conf +1 -0
  67. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mail_ru.conf +1 -0
  68. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/meinvz.conf +1 -0
  69. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/meta.conf +1 -0
  70. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mevio.conf +1 -0
  71. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/motortopia.conf +1 -0
  72. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/msn.conf +1 -0
  73. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/multiply.conf +1 -0
  74. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mycatspace.conf +1 -0
  75. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mydogspace.conf +1 -0
  76. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mynet.conf +1 -0
  77. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/myspace.conf +1 -0
  78. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/netaddress.conf +1 -0
  79. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/netlog.conf +1 -0
  80. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/ning.conf +1 -0
  81. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/nz11.conf +1 -0
  82. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/o2.conf +1 -0
  83. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/operamail.conf +1 -0
  84. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/orkut.conf +1 -0
  85. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/perfspot.conf +1 -0
  86. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/plaxo.conf +1 -0
  87. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/plazes.conf +1 -0
  88. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/plurk.conf +1 -0
  89. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/pochta.conf +1 -0
  90. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/popstarmail.conf +1 -0
  91. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/rambler.conf +1 -0
  92. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/rediff.conf +1 -0
  93. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/sapo.conf +1 -0
  94. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/skyrock.conf +1 -0
  95. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/tagged.conf +1 -0
  96. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/techemail.conf +1 -0
  97. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/terra.conf +1 -0
  98. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/twitter.conf +1 -0
  99. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/uk2.conf +1 -0
  100. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/vimeo.conf +1 -0
  101. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/virgilio.conf +1 -0
  102. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/vkontakte.conf +1 -0
  103. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/walla.conf +1 -0
  104. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/web_de.conf +1 -0
  105. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/wpl.conf +1 -0
  106. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/xanga.conf +1 -0
  107. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/xing.conf +1 -0
  108. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/xuqa.conf +1 -0
  109. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/yahoo.conf +1 -0
  110. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/yandex.conf +1 -0
  111. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/youtube.conf +1 -0
  112. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/zapak.conf +1 -0
  113. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/config.php +20 -0
  114. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/images/ers.gif +0 -0
  115. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/images/oks.gif +0 -0
  116. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/notifier.php +69 -0
  117. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/openinviter.php +544 -0
  118. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/_base.php +762 -0
  119. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/_hosted.plg.php +118 -0
  120. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/abv.plg.php +211 -0
  121. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/aol.plg.php +204 -0
  122. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/apropo.plg.php +186 -0
  123. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/atlas.plg.php +177 -0
  124. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/aussiemail.plg.php +161 -0
  125. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/azet.plg.php +147 -0
  126. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/badoo.plg.php +157 -0
  127. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/bebo.plg.php +193 -0
  128. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/bigstring.plg.php +136 -0
  129. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/bookcrossing.plg.php +171 -0
  130. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/bordermail.plg.php +194 -0
  131. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/brazencareerist.plg.php +197 -0
  132. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/canoe.plg.php +180 -0
  133. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/care2.plg.php +189 -0
  134. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/clevergo.plg.php +181 -0
  135. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/cyworld.plg.php +209 -0
  136. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/doramail.plg.php +231 -0
  137. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/eons.plg.php +198 -0
  138. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/evite.plg.php +137 -0
  139. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/facebook.plg.php +258 -0
  140. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/faces.plg.php +173 -0
  141. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/famiva.plg.php +150 -0
  142. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/fastmail.plg.php +254 -0
  143. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/fdcareer.plg.php +189 -0
  144. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/flickr.plg.php +210 -0
  145. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/flingr.plg.php +184 -0
  146. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/flixster.plg.php +207 -0
  147. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/fm5.plg.php +187 -0
  148. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/freemail.plg.php +149 -0
  149. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/friendfeed.plg.php +191 -0
  150. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/friendster.plg.php +207 -0
  151. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/gawab.plg.php +177 -0
  152. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/gmail.plg.php +170 -0
  153. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/gmx_net.plg.php +203 -0
  154. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/graffiti.plg.php +142 -0
  155. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/hi5.plg.php +206 -0
  156. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/hotmail.plg.php +225 -0
  157. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/hushmail.plg.php +153 -0
  158. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/hyves.plg.php +223 -0
  159. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/inbox.plg.php +176 -0
  160. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/india.plg.php +180 -0
  161. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/indiatimes.plg.php +188 -0
  162. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/inet.plg.php +173 -0
  163. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/interia.plg.php +170 -0
  164. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/katamail.plg.php +155 -0
  165. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/kids.plg.php +151 -0
  166. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/kincafe.plg.php +126 -0
  167. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/konnects.plg.php +204 -0
  168. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/koolro.plg.php +181 -0
  169. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/lastfm.plg.php +142 -0
  170. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/libero.plg.php +192 -0
  171. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/linkedin.plg.php +171 -0
  172. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/livejournal.plg.php +193 -0
  173. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/lovento.plg.php +181 -0
  174. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/lycos.plg.php +177 -0
  175. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mail2world.plg.php +184 -0
  176. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mail_com.plg.php +195 -0
  177. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mail_in.plg.php +141 -0
  178. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mail_ru.plg.php +174 -0
  179. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/meinvz.plg.php +202 -0
  180. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/meta.plg.php +173 -0
  181. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mevio.plg.php +209 -0
  182. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/motortopia.plg.php +179 -0
  183. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/msn.plg.php +205 -0
  184. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/multiply.plg.php +192 -0
  185. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mycatspace.plg.php +179 -0
  186. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mydogspace.plg.php +179 -0
  187. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mynet.plg.php +209 -0
  188. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/myspace.plg.php +189 -0
  189. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/netaddress.plg.php +196 -0
  190. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/netlog.plg.php +172 -0
  191. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/ning.plg.php +166 -0
  192. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/nz11.plg.php +151 -0
  193. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/o2.plg.php +175 -0
  194. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/operamail.plg.php +181 -0
  195. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/orkut.plg.php +205 -0
  196. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/perfspot.plg.php +209 -0
  197. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/plaxo.plg.php +136 -0
  198. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/plazes.plg.php +186 -0
  199. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/plurk.plg.php +181 -0
  200. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/pochta.plg.php +171 -0
  201. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/popstarmail.plg.php +183 -0
  202. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/rambler.plg.php +143 -0
  203. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/rediff.plg.php +162 -0
  204. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/sapo.plg.php +130 -0
  205. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/skyrock.plg.php +206 -0
  206. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/tagged.plg.php +192 -0
  207. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/techemail.plg.php +143 -0
  208. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/terra.plg.php +149 -0
  209. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/twitter.plg.php +160 -0
  210. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/uk2.plg.php +186 -0
  211. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/vimeo.plg.php +195 -0
  212. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/virgilio.plg.php +141 -0
  213. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/vkontakte.plg.php +195 -0
  214. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/walla.plg.php +148 -0
  215. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/web_de.plg.php +137 -0
  216. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/wpl.plg.php +158 -0
  217. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/xanga.plg.php +188 -0
  218. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/xing.plg.php +207 -0
  219. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/xuqa.plg.php +209 -0
  220. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/yahoo.plg.php +154 -0
  221. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/yandex.plg.php +121 -0
  222. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/youtube.plg.php +193 -0
  223. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/zapak.plg.php +153 -0
  224. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/stats.php +85 -0
  225. app/code/community/Auguria/Sponsorship/Model/Adminhtml/System/Config/Backend/Sponsorship/Openinviter.php +40 -0
  226. app/code/community/Auguria/Sponsorship/Model/EmptyPHP.php +0 -266
  227. app/code/community/Auguria/Sponsorship/Model/Observer.php +33 -0
  228. app/code/community/Auguria/Sponsorship/Model/Openinviter.php +52 -0
  229. app/code/community/Auguria/Sponsorship/controllers/IndexController.php +10 -4
  230. app/code/community/Auguria/Sponsorship/controllers/OpeninviterController.php +136 -0
  231. app/code/community/Auguria/Sponsorship/controllers/SponsorController.php +2 -28
  232. app/code/community/Auguria/Sponsorship/etc/config.xml +18 -3
  233. app/code/community/Auguria/Sponsorship/etc/system.xml +37 -0
  234. app/design/frontend/default/default/layout/sponsorship.xml +18 -0
  235. app/design/frontend/default/default/template/sponsorship/openinviter.phtml +68 -0
  236. app/design/frontend/default/default/template/sponsorship/openinviterimport.phtml +109 -0
  237. app/design/frontend/default/default/template/sponsorship/sponsorship.phtml +65 -37
  238. app/locale/fr_FR/Auguria_Sponsorship.csv +16 -0
  239. package.xml +4 -4
app/code/community/Auguria/Sponsorship/Block/Adminhtml/Link/Grid.php CHANGED
@@ -22,7 +22,7 @@ class Auguria_Sponsorship_Block_Adminhtml_Link_Grid extends Mage_Adminhtml_Block
22
  $firstname = $customer->getAttribute('firstname');
23
  $lastname = $customer->getAttribute('lastname');
24
  $core = Mage::getSingleton('core/resource');
25
-
26
  $collection = Mage::getResourceModel('customer/customer_collection')
27
  ->addAttributeToSelect("sponsor")
28
  ->addNameToSelect()
@@ -30,7 +30,7 @@ class Auguria_Sponsorship_Block_Adminhtml_Link_Grid extends Mage_Adminhtml_Block
30
  new Zend_Db_Expr('CONCAT((select cev.value from '.$core->getTableName('customer_entity_varchar').' cev where cev.entity_id={{sponsor}} and cev.attribute_id='.(int) $firstname->getAttributeId().')," ",(select cev.value from '.$core->getTableName('customer_entity_varchar').' cev where cev.entity_id={{sponsor}} and cev.attribute_id='.(int) $lastname->getAttributeId().'))'),
31
  'sponsor')
32
  ->addExpressionAttributeToSelect('date_last_order',
33
- new Zend_Db_Expr('(select max(so.created_at) from '.$core->getTableName('sales_order').' so where so.customer_id={{entity_id}})'),
34
  'entity_id')
35
  ->addAttributeToFilter("sponsor", array('neq'=> array(0)))
36
  ;
22
  $firstname = $customer->getAttribute('firstname');
23
  $lastname = $customer->getAttribute('lastname');
24
  $core = Mage::getSingleton('core/resource');
25
+
26
  $collection = Mage::getResourceModel('customer/customer_collection')
27
  ->addAttributeToSelect("sponsor")
28
  ->addNameToSelect()
30
  new Zend_Db_Expr('CONCAT((select cev.value from '.$core->getTableName('customer_entity_varchar').' cev where cev.entity_id={{sponsor}} and cev.attribute_id='.(int) $firstname->getAttributeId().')," ",(select cev.value from '.$core->getTableName('customer_entity_varchar').' cev where cev.entity_id={{sponsor}} and cev.attribute_id='.(int) $lastname->getAttributeId().'))'),
31
  'sponsor')
32
  ->addExpressionAttributeToSelect('date_last_order',
33
+ new Zend_Db_Expr('(select max(so.created_at) from '.$core->getTableName('sales/order').' so where so.customer_id={{entity_id}})'),
34
  'entity_id')
35
  ->addAttributeToFilter("sponsor", array('neq'=> array(0)))
36
  ;
app/code/community/Auguria/Sponsorship/Block/Openinviter.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Auguria
4
+ * @package Auguria_Sponsorship
5
+ * @author Auguria
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Auguria_Sponsorship_Block_Openinviter extends Mage_Core_Block_Template
9
+ {
10
+ public function _prepareLayout()
11
+ {
12
+ return parent::_prepareLayout();
13
+ }
14
+
15
+ public function getOpenInviterStep()
16
+ {
17
+ $form = Mage::getSingleton('customer/session')->getData('openinviter_form');
18
+ if (isset($form['step']))
19
+ return $form['step'];
20
+ elseif($this->getRequest()->getParam('step'))
21
+ return $this->getRequest()->getParam('step');
22
+ else
23
+ return 'get_contacts';
24
+ }
25
+
26
+ public function getOpenIniviterPlugins()
27
+ {
28
+ $form = Mage::getSingleton('customer/session')->getData('openinviter_form');
29
+ if (isset($form['plugins']))
30
+ return $form['plugins'];
31
+ else
32
+ return array();
33
+ }
34
+
35
+ public function getOpenInviterTypes()
36
+ {
37
+ $form = Mage::getSingleton('customer/session')->getData('openinviter_form');
38
+ if (isset($form['types']))
39
+ return $form['types'];
40
+ else
41
+ return array();
42
+ }
43
+
44
+ public function getOpenInviterEmailBox()
45
+ {
46
+ $form = Mage::getSingleton('customer/session')->getData('openinviter_form');
47
+ if (isset($form['email_box']))
48
+ return $form['email_box'];
49
+
50
+ }
51
+
52
+ public function getOpenInviterProviderBox()
53
+ {
54
+ $form = Mage::getSingleton('customer/session')->getData('openinviter_form');
55
+ if (isset($form['provider_box']))
56
+ return $form['provider_box'];
57
+ }
58
+
59
+ public function getOpenInviterContacts()
60
+ {
61
+ $form = Mage::getSingleton('customer/session')->getData('openinviter_form');
62
+ if (isset($form['contacts']))
63
+ return $form['contacts'];
64
+ }
65
+ }
app/code/community/Auguria/Sponsorship/Block/Sponsorship.php CHANGED
@@ -6,7 +6,7 @@
6
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
  */
8
  class Auguria_Sponsorship_Block_Sponsorship extends Mage_Core_Block_Template
9
- {
10
  public function _prepareLayout()
11
  {
12
  return parent::_prepareLayout();
@@ -28,11 +28,17 @@ class Auguria_Sponsorship_Block_Sponsorship extends Mage_Core_Block_Template
28
 
29
  public function getUserName()
30
  {
31
- if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
32
  return '';
 
 
 
 
 
 
 
 
33
  }
34
- $customer = Mage::getSingleton('customer/session')->getCustomer();
35
- return trim($customer->getFirstname()).' '.trim($customer->getLastname());
36
  }
37
 
38
  public function getCustomerId ()
@@ -45,13 +51,42 @@ class Auguria_Sponsorship_Block_Sponsorship extends Mage_Core_Block_Template
45
 
46
  public function getUserEmail()
47
  {
48
- if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
49
  return '';
 
 
 
 
 
 
 
50
  }
51
- $customer = Mage::getSingleton('customer/session')->getCustomer();
52
- return $customer->getEmail();
53
  }
54
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  public function getFooterMessage()
56
  {
57
  return Mage::helper('sponsorship/mail')->getFooterMessage ($this->getCustomerId());
6
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
  */
8
  class Auguria_Sponsorship_Block_Sponsorship extends Mage_Core_Block_Template
9
+ {
10
  public function _prepareLayout()
11
  {
12
  return parent::_prepareLayout();
28
 
29
  public function getUserName()
30
  {
31
+ if (!Mage::getSingleton('customer/session')->isLoggedIn())
32
  return '';
33
+
34
+ $form = Mage::getSingleton('customer/session')->getData('sponsorship_form');
35
+ if (isset($form['sender']['name']))
36
+ return $form['sender']['name'];
37
+ else
38
+ {
39
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
40
+ return trim($customer->getFirstname()).' '.trim($customer->getLastname());
41
  }
 
 
42
  }
43
 
44
  public function getCustomerId ()
51
 
52
  public function getUserEmail()
53
  {
54
+ if (!Mage::getSingleton('customer/session')->isLoggedIn())
55
  return '';
56
+ $form = Mage::getSingleton('customer/session')->getData('sponsorship_form');
57
+ if (isset($form['sender']['email']))
58
+ return $form['sender']['email'];
59
+ else
60
+ {
61
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
62
+ return $customer->getEmail();
63
  }
 
 
64
  }
65
+
66
+ public function getSubject()
67
+ {
68
+ if (!Mage::getSingleton('customer/session')->isLoggedIn())
69
+ return '';
70
+
71
+ $form = Mage::getSingleton('customer/session')->getData('sponsorship_form');
72
+ if (isset($form['message']['subject']))
73
+ return $form['message']['subject'];
74
+ else
75
+ return Mage::helper('sponsorship/mail')->getSubject();
76
+ }
77
+
78
+ public function getBodyMessage()
79
+ {
80
+ if (!Mage::getSingleton('customer/session')->isLoggedIn())
81
+ return '';
82
+
83
+ $form = Mage::getSingleton('customer/session')->getData('sponsorship_form');
84
+ if (isset($form['message']['body']))
85
+ return $form['message']['body'];
86
+ else
87
+ return Mage::helper('sponsorship/mail')->getMessage();
88
+ }
89
+
90
  public function getFooterMessage()
91
  {
92
  return Mage::helper('sponsorship/mail')->getFooterMessage ($this->getCustomerId());
app/code/community/Auguria/Sponsorship/Helper/Mail.php CHANGED
@@ -88,6 +88,7 @@ class Auguria_Sponsorship_Helper_Mail extends Mage_Core_Helper_Abstract
88
  $i = 0;
89
  $mails = Array();
90
  $valid = true;
 
91
  foreach ($post['recipient']['email'] as $recipient_email)
92
  {
93
  $mails[$i]["sender_name"] = $sender_name;
88
  $i = 0;
89
  $mails = Array();
90
  $valid = true;
91
+ if (isset($post['recipient']['email']))
92
  foreach ($post['recipient']['email'] as $recipient_email)
93
  {
94
  $mails[$i]["sender_name"] = $sender_name;
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/LICENSE.txt ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Library General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+ GNU GENERAL PUBLIC LICENSE
59
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
60
+
61
+ 0. This License applies to any program or other work which contains
62
+ a notice placed by the copyright holder saying it may be distributed
63
+ under the terms of this General Public License. The "Program", below,
64
+ refers to any such program or work, and a "work based on the Program"
65
+ means either the Program or any derivative work under copyright law:
66
+ that is to say, a work containing the Program or a portion of it,
67
+ either verbatim or with modifications and/or translated into another
68
+ language. (Hereinafter, translation is included without limitation in
69
+ the term "modification".) Each licensee is addressed as "you".
70
+
71
+ Activities other than copying, distribution and modification are not
72
+ covered by this License; they are outside its scope. The act of
73
+ running the Program is not restricted, and the output from the Program
74
+ is covered only if its contents constitute a work based on the
75
+ Program (independent of having been made by running the Program).
76
+ Whether that is true depends on what the Program does.
77
+
78
+ 1. You may copy and distribute verbatim copies of the Program's
79
+ source code as you receive it, in any medium, provided that you
80
+ conspicuously and appropriately publish on each copy an appropriate
81
+ copyright notice and disclaimer of warranty; keep intact all the
82
+ notices that refer to this License and to the absence of any warranty;
83
+ and give any other recipients of the Program a copy of this License
84
+ along with the Program.
85
+
86
+ You may charge a fee for the physical act of transferring a copy, and
87
+ you may at your option offer warranty protection in exchange for a fee.
88
+
89
+ 2. You may modify your copy or copies of the Program or any portion
90
+ of it, thus forming a work based on the Program, and copy and
91
+ distribute such modifications or work under the terms of Section 1
92
+ above, provided that you also meet all of these conditions:
93
+
94
+ a) You must cause the modified files to carry prominent notices
95
+ stating that you changed the files and the date of any change.
96
+
97
+ b) You must cause any work that you distribute or publish, that in
98
+ whole or in part contains or is derived from the Program or any
99
+ part thereof, to be licensed as a whole at no charge to all third
100
+ parties under the terms of this License.
101
+
102
+ c) If the modified program normally reads commands interactively
103
+ when run, you must cause it, when started running for such
104
+ interactive use in the most ordinary way, to print or display an
105
+ announcement including an appropriate copyright notice and a
106
+ notice that there is no warranty (or else, saying that you provide
107
+ a warranty) and that users may redistribute the program under
108
+ these conditions, and telling the user how to view a copy of this
109
+ License. (Exception: if the Program itself is interactive but
110
+ does not normally print such an announcement, your work based on
111
+ the Program is not required to print an announcement.)
112
+ These requirements apply to the modified work as a whole. If
113
+ identifiable sections of that work are not derived from the Program,
114
+ and can be reasonably considered independent and separate works in
115
+ themselves, then this License, and its terms, do not apply to those
116
+ sections when you distribute them as separate works. But when you
117
+ distribute the same sections as part of a whole which is a work based
118
+ on the Program, the distribution of the whole must be on the terms of
119
+ this License, whose permissions for other licensees extend to the
120
+ entire whole, and thus to each and every part regardless of who wrote it.
121
+
122
+ Thus, it is not the intent of this section to claim rights or contest
123
+ your rights to work written entirely by you; rather, the intent is to
124
+ exercise the right to control the distribution of derivative or
125
+ collective works based on the Program.
126
+
127
+ In addition, mere aggregation of another work not based on the Program
128
+ with the Program (or with a work based on the Program) on a volume of
129
+ a storage or distribution medium does not bring the other work under
130
+ the scope of this License.
131
+
132
+ 3. You may copy and distribute the Program (or a work based on it,
133
+ under Section 2) in object code or executable form under the terms of
134
+ Sections 1 and 2 above provided that you also do one of the following:
135
+
136
+ a) Accompany it with the complete corresponding machine-readable
137
+ source code, which must be distributed under the terms of Sections
138
+ 1 and 2 above on a medium customarily used for software interchange; or,
139
+
140
+ b) Accompany it with a written offer, valid for at least three
141
+ years, to give any third party, for a charge no more than your
142
+ cost of physically performing source distribution, a complete
143
+ machine-readable copy of the corresponding source code, to be
144
+ distributed under the terms of Sections 1 and 2 above on a medium
145
+ customarily used for software interchange; or,
146
+
147
+ c) Accompany it with the information you received as to the offer
148
+ to distribute corresponding source code. (This alternative is
149
+ allowed only for noncommercial distribution and only if you
150
+ received the program in object code or executable form with such
151
+ an offer, in accord with Subsection b above.)
152
+
153
+ The source code for a work means the preferred form of the work for
154
+ making modifications to it. For an executable work, complete source
155
+ code means all the source code for all modules it contains, plus any
156
+ associated interface definition files, plus the scripts used to
157
+ control compilation and installation of the executable. However, as a
158
+ special exception, the source code distributed need not include
159
+ anything that is normally distributed (in either source or binary
160
+ form) with the major components (compiler, kernel, and so on) of the
161
+ operating system on which the executable runs, unless that component
162
+ itself accompanies the executable.
163
+
164
+ If distribution of executable or object code is made by offering
165
+ access to copy from a designated place, then offering equivalent
166
+ access to copy the source code from the same place counts as
167
+ distribution of the source code, even though third parties are not
168
+ compelled to copy the source along with the object code.
169
+ 4. You may not copy, modify, sublicense, or distribute the Program
170
+ except as expressly provided under this License. Any attempt
171
+ otherwise to copy, modify, sublicense or distribute the Program is
172
+ void, and will automatically terminate your rights under this License.
173
+ However, parties who have received copies, or rights, from you under
174
+ this License will not have their licenses terminated so long as such
175
+ parties remain in full compliance.
176
+
177
+ 5. You are not required to accept this License, since you have not
178
+ signed it. However, nothing else grants you permission to modify or
179
+ distribute the Program or its derivative works. These actions are
180
+ prohibited by law if you do not accept this License. Therefore, by
181
+ modifying or distributing the Program (or any work based on the
182
+ Program), you indicate your acceptance of this License to do so, and
183
+ all its terms and conditions for copying, distributing or modifying
184
+ the Program or works based on it.
185
+
186
+ 6. Each time you redistribute the Program (or any work based on the
187
+ Program), the recipient automatically receives a license from the
188
+ original licensor to copy, distribute or modify the Program subject to
189
+ these terms and conditions. You may not impose any further
190
+ restrictions on the recipients' exercise of the rights granted herein.
191
+ You are not responsible for enforcing compliance by third parties to
192
+ this License.
193
+
194
+ 7. If, as a consequence of a court judgment or allegation of patent
195
+ infringement or for any other reason (not limited to patent issues),
196
+ conditions are imposed on you (whether by court order, agreement or
197
+ otherwise) that contradict the conditions of this License, they do not
198
+ excuse you from the conditions of this License. If you cannot
199
+ distribute so as to satisfy simultaneously your obligations under this
200
+ License and any other pertinent obligations, then as a consequence you
201
+ may not distribute the Program at all. For example, if a patent
202
+ license would not permit royalty-free redistribution of the Program by
203
+ all those who receive copies directly or indirectly through you, then
204
+ the only way you could satisfy both it and this License would be to
205
+ refrain entirely from distribution of the Program.
206
+
207
+ If any portion of this section is held invalid or unenforceable under
208
+ any particular circumstance, the balance of the section is intended to
209
+ apply and the section as a whole is intended to apply in other
210
+ circumstances.
211
+
212
+ It is not the purpose of this section to induce you to infringe any
213
+ patents or other property right claims or to contest validity of any
214
+ such claims; this section has the sole purpose of protecting the
215
+ integrity of the free software distribution system, which is
216
+ implemented by public license practices. Many people have made
217
+ generous contributions to the wide range of software distributed
218
+ through that system in reliance on consistent application of that
219
+ system; it is up to the author/donor to decide if he or she is willing
220
+ to distribute software through any other system and a licensee cannot
221
+ impose that choice.
222
+
223
+ This section is intended to make thoroughly clear what is believed to
224
+ be a consequence of the rest of this License.
225
+
226
+ 8. If the distribution and/or use of the Program is restricted in
227
+ certain countries either by patents or by copyrighted interfaces, the
228
+ original copyright holder who places the Program under this License
229
+ may add an explicit geographical distribution limitation excluding
230
+ those countries, so that distribution is permitted only in or among
231
+ countries not thus excluded. In such case, this License incorporates
232
+ the limitation as if written in the body of this License.
233
+
234
+ 9. The Free Software Foundation may publish revised and/or new versions
235
+ of the General Public License from time to time. Such new versions will
236
+ be similar in spirit to the present version, but may differ in detail to
237
+ address new problems or concerns.
238
+
239
+ Each version is given a distinguishing version number. If the Program
240
+ specifies a version number of this License which applies to it and "any
241
+ later version", you have the option of following the terms and conditions
242
+ either of that version or of any later version published by the Free
243
+ Software Foundation. If the Program does not specify a version number of
244
+ this License, you may choose any version ever published by the Free Software
245
+ Foundation.
246
+
247
+ 10. If you wish to incorporate parts of the Program into other free
248
+ programs whose distribution conditions are different, write to the author
249
+ to ask for permission. For software which is copyrighted by the Free
250
+ Software Foundation, write to the Free Software Foundation; we sometimes
251
+ make exceptions for this. Our decision will be guided by the two goals
252
+ of preserving the free status of all derivatives of our free software and
253
+ of promoting the sharing and reuse of software generally.
254
+
255
+ NO WARRANTY
256
+
257
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
258
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
259
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
260
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
261
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
262
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
263
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
264
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
265
+ REPAIR OR CORRECTION.
266
+
267
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
268
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
269
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
270
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
271
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
272
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
273
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
274
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
275
+ POSSIBILITY OF SUCH DAMAGES.
276
+
277
+ END OF TERMS AND CONDITIONS
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/POLICY.txt ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ PRIVACY POLICY
3
+
4
+ 1. SCOPE
5
+
6
+ 1. This website is operated by OpenInviter Limited.
7
+
8
+ 2. OpenInviter complies with data protection legislation such as the Data
9
+ Protection Act 1998. This regulates the processing of personal data
10
+ relating to you and grants you various rights in respect of your personal
11
+ data.
12
+
13
+ 3. The aim of this statement is to tell you how we will use any data,
14
+ including personal data, you provide through this website. Please read it
15
+ carefully before you proceed.
16
+
17
+
18
+ 2. COLLECTION AND RETENTION OF DATA
19
+
20
+ OpenInviter collects the following data from users of this website:
21
+
22
+ 1. PROFILE DATA
23
+
24
+ This is information that you provide when you register and create a profile
25
+ with OpenInviter. It includes your username and password, a contact email address
26
+ and other information that you provide during the profile set-up process.
27
+
28
+ 2. CONFIGURATION DATA
29
+
30
+ 1. If you have enabled the 'check for updates' setting in the OpenInviter
31
+ software, then OpenInviter will collect information relating to the configuration
32
+ of your server used to run OpenInviter. This information is used to identify
33
+ which product update alerts are relevant to you and to profile the
34
+ community so that we can focus development and testing efforts on common
35
+ inviter configurations. This configuration data includes:
36
+
37
+ 1. the version and basic configuration options of the inviter; and
38
+ 2. type and version information about other software which OpenInviter
39
+ depends on, including: the webserver, PHP and MySQL.
40
+
41
+ 3. WEBSITE DATA
42
+
43
+ 1. OpenInviter collects data regarding anonymous visitors to the OpenInviter website
44
+ including the following:
45
+ 1. the IP address of the user's computer (which may include a domain name);
46
+ 2. the referring URL (if any); and
47
+ 3. details of the Internet browser software used by the user to view
48
+ the OpenInviter website.
49
+ 2. Further, if you use the online "Contact us" feature of the website,
50
+ we collect your name, email address and details of your message to
51
+ enable us to respond to your inquiry.
52
+
53
+
54
+ 3. HOW WE USE YOUR PERSONAL INFORMATION AND WITH WHOM WE SHARE YOUR INFORMATION
55
+
56
+ 1. We use your personal information to manage your online profile, send you
57
+ details of software updates and other general communications. If you have
58
+ indicated that you wish to receive such information, then we may also send
59
+ you information about new products and/or services that OpenInviter provides. You
60
+ can opt-out of receiving future marketing material by changing the relevant
61
+ setting in your OpenInviter profile or by contacting us via our online contact
62
+ form.
63
+
64
+ 2. We will employ the services of third parties to help us in certain
65
+ areas, such as website hosting. In these cases, the third party will
66
+ receive your information, for which you must provide your consent by
67
+ ticking the consent box after you have read this Privacy Policy. However,
68
+ at all times, we will control and be responsible for the use of your
69
+ information.
70
+
71
+
72
+ 4. TRANSFER OF YOUR INFORMATION OUTSIDE EUROPE
73
+
74
+ The hosted version of the OpenInviter software is hosted by a third party located in
75
+ the United States of America. If OpenInviter provides you with the hosted version,
76
+ we may transfer some of your information to this third party. By submitting
77
+ your information to this website in order to receive the hosted version and by
78
+ ticking the consent box after having read this Privacy Policy, you consent to
79
+ such transfers taking place.
80
+
81
+
82
+ 5. COOKIES
83
+
84
+ 1. A cookie is a text-only string of information that a website transfers
85
+ to the cookie file of your computer's hard disk. A cookie will typically
86
+ contain the name of the domain from which the cookie has come, the
87
+ 'lifetime' of the cookie, and a value, usually a randomly generated unique
88
+ number.
89
+
90
+
91
+ 2. When you visit our website we send you a cookie. We use cookies to
92
+ identify you as a valid OpenInviter user, to ensure that no one else can
93
+ simultaneously log in and use your OpenInviter profile and to help you
94
+ personalise your OpenInviter experience in conjunction with your OpenInviter profile.
95
+
96
+ 3. For more information about how cookies work and how to disable them, go
97
+ to http://www.allaboutcookies.org/manage-cookies/ . However, if you choose
98
+ to disable cookies, you will not be able to enjoy a significant portion of
99
+ the OpenInviter website and software functionality.
100
+
101
+
102
+ 6. LINKS
103
+
104
+ Our site contains links to other web sites over which we have no control. We
105
+ are not responsible for privacy policies or practices of other websites to
106
+ which you choose to link from this site. We encourage you to review the
107
+ privacy policies of those other web sites so that you can understand how they
108
+ collect, use and share your information.
109
+
110
+
111
+ 7. SECURITY
112
+
113
+ We have implemented reasonable technical and organisational measures designed
114
+ to secure your personal information from accidental loss and from unauthorised
115
+ access, use, alteration or disclosure. However, the Internet is an open system
116
+ and we cannot guarantee that unauthorised third parties will never be able to
117
+ defeat those measures or use your personal information for improper purposes.
118
+
119
+
120
+ 8. SALE OF THE BUSINESS
121
+
122
+ In the event that the business is sold or integrated with another business,
123
+ your details will be disclosed to our advisers and any prospective purchaser's
124
+ adviser and will be passed to the new owners of the business.
125
+
126
+
127
+ 9. YOUR RIGHT TO ACCESS INFORMATION
128
+
129
+ You are entitled to see the information held about you. If you wish to do
130
+ this, please contact us via our online contact form . We may require you to
131
+ provide verification of your identity to provide a copy of the information we hold.
132
+ We will respond to any request in accordance with the current data protection
133
+ legislation and in any event within 40 days of receipt a valid request. Please
134
+ note that in certain circumstances we may withhold access to your information
135
+ where we have the right to do so under current data protection legislation.
136
+
137
+
138
+ 10. UPDATING YOUR INFORMATION
139
+
140
+ You may review, correct, update or change your personal information at any
141
+ time by changing the relevant setting in your OpenInviter profile or by contacting
142
+ us via our online contact form .
143
+
144
+
145
+ 11. CHANGES TO THIS PRIVACY POLICY
146
+
147
+ If our privacy policy changes in any way, we will place an updated version on
148
+ this page. Regularly reviewing this page ensures that you are always aware of
149
+ what information we collect, how we use it and under what circumstances, if
150
+ any, we will share it with other parties.
151
+
152
+
153
+ CONTACTING US
154
+
155
+ If you have any questions about this statement or your personal information,
156
+ please contact us via our online contact form or by emailing us at
157
+ hello@OpenInviter.com
158
+
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/autoupdate.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ set_time_limit(0);
3
+ if (!is_writable(dirname(__FILE__))) { echo "<b>OpenInviter</b> folder is not writable. Updates will not be posible<br>";exit; }
4
+ if (!is_writable(dirname(__FILE__).'/plugins')) { echo "<b>OpenInviter/plugins</b> folder is not writable. Updates will not be posible<br>";exit; }
5
+ if (file_exists(dirname(__FILE__)."/postinstall.php")) { echo "Delete <b>postinstall.php</b> before running the autoupdater";exit; }
6
+ include(dirname(__FILE__).'/openinviter.php');
7
+ $inviter=new openinviter();
8
+ class update extends openinviter_base
9
+ {
10
+ public $plugins;
11
+
12
+ public $settings;
13
+
14
+ protected $timeout=30;
15
+
16
+ public function makeUpdate()
17
+ {
18
+ $xml=$this->checkVersions();
19
+ if (!empty($xml))
20
+ {
21
+ $update_files=$this->parseXmlUpdates($xml);
22
+ $update=true;$newFiles=array();
23
+ foreach($update_files as $name_file=>$arrayfile)
24
+ if ($arrayfile['type']=='new')
25
+ {
26
+ if(!empty($this->settings['update_files']))
27
+ {
28
+ if (isset($this->plugins[$arrayfile['plugin_type']][$name_file]))
29
+ {
30
+ if (!empty($this->plugins[$arrayfile['plugin_type']][$name_file]['autoupdate'])) $newFiles[$name_file]=array('sum'=>$arrayfile['sum'],'plugin_type'=>$arrayfile['plugin_type']);
31
+ elseif($arrayfile['plugin_type']=='base') $newFiles[$name_file]=array('sum'=>$arrayfile['sum'],'plugin_type'=>$arrayfile['plugin_type']);
32
+ }
33
+ }
34
+ else
35
+ {
36
+ if($arrayfile['plugin_type']=='base') $newFiles[$name_file]=array('sum'=>$arrayfile['sum'],'plugin_type'=>$arrayfile['plugin_type']);
37
+ else $newFiles[$name_file]=array('sum'=>$arrayfile['sum'],'plugin_type'=>$arrayfile['plugin_type']);
38
+ }
39
+ }
40
+
41
+ foreach ($newFiles as $name_file=>$arrayFile)
42
+ {
43
+ $headers=array('Content-Type'=>'application/xml','X_USER'=>$this->settings['username'],'X_SIGNATURE'=>$this->makeSignature($this->settings['private_key'],$this->xmlFile($name_file)));
44
+ $res=$this->getNewFile(gzcompress($this->xmlFile($name_file),9),$headers);
45
+ if (!empty($res))
46
+ {
47
+ $fileDeCmp=gzuncompress($res);$elementsDownload=$this->getElementsDownload($fileDeCmp);
48
+ $file_content=$elementsDownload['fileStrip'];$signatureBulk=$elementsDownload['signatureBulk'];
49
+ $this->verifySignature($signatureBulk,$file_content);
50
+ if ($arrayFile['sum']!=md5($file_content)) $update=false;
51
+ elseif (!file_put_contents($this->getUpdateFilePath($name_file).".tmp",$file_content)) $this->ers("Unable to write new updates");
52
+ }
53
+ else $update=false;
54
+ }
55
+ if ($update)
56
+ {
57
+ foreach($newFiles as $name_file=>$arrayfile)
58
+ {
59
+ file_put_contents($this->getUpdateFilePath($name_file),file_get_contents($this->getUpdateFilePath($name_file).".tmp"));
60
+ unlink($this->getUpdateFilePath($name_file).".tmp");
61
+ $this->writeConf($name_file,$arrayfile['plugin_type']);
62
+ }
63
+ $this->array2Log($update_files);
64
+ }
65
+ else
66
+ {
67
+ foreach($newFiles as $name_file=>$arrayfile) if (file_exists($this->getUpdateFilePath($name_file).".tmp")) unlink($this->getUpdateFilePath($name_file).".tmp");
68
+ if (!$update) $this->ers("Unable to download updates");
69
+ }
70
+ }
71
+ else $this->ers("Unable to connect to Server");
72
+ }
73
+
74
+ public function writeConf($name_file,$type=false)
75
+ {
76
+ if (!file_exists(dirname(__FILE__)."/conf")) mkdir(dirname(__FILE__)."/conf",0755,true);
77
+ if ($type=='social') { if (!file_exists(dirname(__FILE__)."/conf/{$name_file}.conf")) file_put_contents(dirname(__FILE__)."/conf/{$name_file}.conf",'<?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>'); }
78
+ elseif($type=='email') { if (!file_exists(dirname(__FILE__)."/conf/{$name_file}.conf")) file_put_contents(dirname(__FILE__)."/conf/{$name_file}.conf",'<?php $enable=true;$autoUpdate=true; ?>'); }
79
+ }
80
+
81
+ private function verifySignature($signatureBulk,$fileContent)
82
+ {
83
+ if (strpos($signatureBulk,'X_SIGNATURE:')===false) $this->ers("INVALID SIGNATURE");
84
+ else
85
+ {
86
+ $start=strpos($signatureBulk,'X_SIGNATURE:')+strlen('X_SIGNATURE:');$end=strlen($signatureBulk);
87
+ $signature=trim(substr($signatureBulk,$start,$end-$start));
88
+ $signature_check=$this->makeSignature($this->settings['private_key'],$fileContent);
89
+ if($signature!=$signature_check) $this->ers("Invalid SIGNATURE");
90
+ else return true;
91
+ }
92
+ }
93
+
94
+ public function getElementsDownload($res)
95
+ {
96
+ $start=0;$end=strpos($res,"<?");$signatureBulk=trim(substr($res,$start,$end));$fileStriped=str_replace($signatureBulk,'',$res);
97
+ if (empty($signatureBulk)) $this->ers("Invalid Signature");
98
+ if (empty($fileStriped)) $this->ers("Unable to download");
99
+ return array('signatureBulk'=>$signatureBulk,'fileStrip'=>$fileStriped);
100
+ }
101
+
102
+ protected function getUpdateFilePath($plugin)
103
+ {
104
+ if ($plugin=='openinviter') return dirname(__FILE__)."/{$plugin}.php";
105
+ elseif($plugin=='_base') return dirname(__FILE__)."/plugins/{$plugin}.php";
106
+ else return dirname(__FILE__)."/plugins/{$plugin}.plg.php";
107
+ }
108
+
109
+ public function xmlFile($file_name)
110
+ {
111
+ return "<request><api_version>1.8</api_version><file>{$file_name}</file></request>";
112
+ }
113
+
114
+ public function xmlVersions()
115
+ {
116
+ $xml="<request><api_version>1.8</api_version><services>";
117
+ if (!empty($this->plugins))
118
+ foreach ($this->plugins as $type=>$dummy)
119
+ foreach ($dummy as $plugin=>$details)
120
+ $xml.="<service name='{$details['name']}'>
121
+ <version>{$details['version']}</version>
122
+ </service>";
123
+ else $xml.="<service name=''>
124
+ <version></version>
125
+ </service>
126
+ ";
127
+ return $xml.="</services></request>";
128
+ }
129
+
130
+ public function checkVersions()
131
+ {
132
+ $this->init();
133
+ $xml=$this->xmlVersions();
134
+ $headers=array('Content-Type'=>'application/xml','X_USER'=>$this->settings['username'],'X_SIGNATURE'=>$this->makeSignature($this->settings['private_key'],$xml));
135
+ $res=gzuncompress($this->post("http://openinviter.com/service_download.php",gzcompress($xml,9),false,false,false,$headers,true));
136
+ $this->stopPlugin();
137
+ if ((empty($res))) $this->ers("Unable to Connect to Server");
138
+ elseif (strpos($res,'<error>')!==false) {$res=str_replace("<error>","",str_replace("</error>","",$res));$this->ers($res);}
139
+ return $res;
140
+ }
141
+
142
+ public function parseXmlUpdates($xml)
143
+ {
144
+ $versions=array();
145
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($xml)) $doc->loadHTML($xml);libxml_use_internal_errors(false);
146
+ $xpath=new DOMXPath($doc);$query="//service";$data=$xpath->query($query);
147
+ foreach($data as $node) $versions[(string)$node->childNodes->item(0)->nodeValue]=array('type'=>(string)$node->childNodes->item(2)->nodeValue,'sum'=>(string)$node->childNodes->item(1)->nodeValue,'plugin_type'=>(string)$node->childNodes->item(3)->nodeValue);
148
+ return $versions;
149
+ }
150
+
151
+ public function getNewFile($xml,$headers)
152
+ {
153
+ $this->init();
154
+ $res=$this->post("http://openinviter.com/service_download.php",$xml,false,false,false,$headers,true);
155
+ $this->stopPlugin();
156
+ return $res;
157
+ }
158
+
159
+ private function makeSignature($var1,$var2)
160
+ {
161
+ return md5(md5($var1).md5($var2));
162
+ }
163
+
164
+ private function array2Log($array)
165
+ {
166
+ $date=date("Y-m-d H:i:s");$updateCount=0;
167
+ $string="[$date] UPDATE STARTED\r\n";
168
+ foreach($array as $key=>$values) if ($values['type']=='new') { $string.="\tUPDATED: {$key}.php\r\n";$updateCount++; }
169
+ $string.="\tUPDATE DONE. {$updateCount} FILES UPDATED\r\n";
170
+ $this->writeLog($string);
171
+ }
172
+
173
+ public function ers($contents)
174
+ {
175
+ $string="[".date("Y-m-d H:i:s")."] ERROR ".$contents."\r\n";
176
+ $this->writeLog($string);
177
+ echo $string;
178
+ exit;
179
+ }
180
+
181
+ public function writeLog($contents)
182
+ {
183
+ $fp=fopen($this->settings['cookie_path'].'/oi_update_log.txt','a+');if ($fp) { fwrite($fp,$contents);fclose($fp); }
184
+ }
185
+
186
+ public function login($user,$pass)
187
+ {
188
+ return;
189
+ }
190
+
191
+ public function getMyContacts()
192
+ {
193
+ return;
194
+ }
195
+
196
+ public function logout()
197
+ {
198
+ return;
199
+ }
200
+
201
+ }
202
+ $plugins=$inviter->getPlugins(true);
203
+ $files_base['base']=array('openinviter'=>array('name'=>'openinviter','version'=>$inviter->getVersion()),'_base'=>array('name'=>'_base','version'=>$inviter->getVersion()));
204
+ $update=new update();
205
+ $update->settings=$inviter->settings;
206
+ $update->plugins=(!empty($plugins)?array_merge($files_base,$plugins):$files_base);
207
+ $update->service_user='updater';
208
+ $update->service_pass='updater';
209
+ $update->service='updater';
210
+ $update->makeUpdate();
211
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/_hosted.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=false;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/abv.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/aol.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/apropo.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/atlas.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/aussiemail.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/azet.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/badoo.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/bebo.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/bigstring.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/bookcrossing.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/bordermail.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/brazencareerist.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/canoe.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/care2.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/clevergo.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/cyworld.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/doramail.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/eons.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/evite.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/facebook.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=2;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/faces.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/famiva.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/fastmail.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/fdcareer.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/flickr.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/flingr.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/flixster.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/fm5.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/freemail.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/friendfeed.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/friendster.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/gawab.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/gmail.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/gmx_net.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/graffiti.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/hi5.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/hotmail.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/hushmail.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/hyves.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/inbox.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/india.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/indiatimes.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/inet.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/interia.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/katamail.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/kids.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/kincafe.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/konnects.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/koolro.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/lastfm.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/libero.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/linkedin.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/livejournal.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/lovento.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/lycos.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mail2world.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mail_com.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mail_in.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mail_ru.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/meinvz.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/meta.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mevio.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/motortopia.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/msn.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/multiply.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mycatspace.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mydogspace.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/mynet.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/myspace.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/netaddress.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/netlog.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/ning.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/nz11.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/o2.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/operamail.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/orkut.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/perfspot.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/plaxo.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/plazes.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/plurk.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/pochta.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/popstarmail.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/rambler.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/rediff.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/sapo.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/skyrock.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/tagged.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/techemail.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/terra.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/twitter.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/uk2.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/vimeo.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/virgilio.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/vkontakte.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/walla.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/web_de.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/wpl.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/xanga.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/xing.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/xuqa.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/yahoo.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/yandex.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/youtube.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/conf/zapak.conf ADDED
@@ -0,0 +1 @@
 
1
+ <?php $enable=true;$autoUpdate=true; ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/config.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $openinviter_settings=array(
3
+ 'username'=>"",
4
+ 'private_key'=>"",
5
+ 'cookie_path'=>"/tmp",
6
+ 'transport'=>"curl",
7
+ 'local_debug'=>"on_error",
8
+ 'remote_debug'=>"",
9
+ 'hosted'=>"",
10
+ 'proxies'=>array(),
11
+ 'stats'=>"",
12
+ 'plugins_cache_time'=>"1800",
13
+ 'plugins_cache_file'=>"oi_plugins.php",
14
+ 'update_files'=>"0",
15
+ 'stats_user'=>"",
16
+ 'stats_password'=>"",
17
+ 'message_body'=>"",
18
+ 'message_subject'=>""
19
+ );
20
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/images/ers.gif ADDED
Binary file
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/images/oks.gif ADDED
Binary file
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/notifier.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Created on Sep 3, 2008
4
+ *
5
+ * Owner: DORU
6
+ */
7
+ class notifications_response
8
+ {
9
+ private $response="";
10
+
11
+ private $ersArray=array(
12
+ 'method'=>array('code'=>'100','desc'=>'Invalid Method','fatal'=>false),
13
+ 'headers'=>array('code'=>'101','desc'=>'Incomplete headers','fatal'=>true),
14
+ 'post'=>array('code'=>'102','desc'=>'Invalid POST content','fatal'=>false),
15
+ 'auth'=>array('code'=>'103','desc'=>'Bad authentification data','fatal'=>true),
16
+ 'xml'=>array('code'=>'105','desc'=>'Invalid XML structure','fatal'=>true),
17
+ 'api_version'=>array('code'=>'106', 'desc'=>'Invalid Api version please upgrade manually','fatal'=>true),
18
+ );
19
+
20
+ private $privateKey;
21
+ private $username;
22
+
23
+ private function getAuth()
24
+ {
25
+ include(dirname(__FILE__).'/config.php');
26
+ $this->privateKey=$openinviter_settings['private_key'];
27
+ $this->username=$openinviter_settings['username'];
28
+ global $HTTP_RAW_POST_DATA;
29
+ if ($_SERVER['REQUEST_METHOD']!='POST') $this->error('method');
30
+ if (!isset($_SERVER['HTTP_X_USER'])) $this->error('headers');
31
+ elseif (!isset($_SERVER['HTTP_X_SIGNATURE'])) $this->error('headers');
32
+ if (empty($HTTP_RAW_POST_DATA)) $this->error('post');
33
+ $this->user=htmlentities($_SERVER['HTTP_X_USER'],ENT_QUOTES);
34
+ $xml=trim(gzuncompress($HTTP_RAW_POST_DATA));
35
+ $signature=$_SERVER['HTTP_X_SIGNATURE'];
36
+ if ($this->username!=$this->user) $this->error('auth');
37
+ $signature_check=$this->makeSignature($this->privateKey,$xml);
38
+ if ($signature_check!=$signature) $this->error('auth');
39
+ if ($xml=='<notification>CHECK STATUS</notification>') $this->requestTypes='check';
40
+ elseif ($xml=='<notification>UPDATE</notification>') $this->requestTypes='update';
41
+ else $this->error['xml'];
42
+ return true;
43
+ }
44
+
45
+ public function response()
46
+ {
47
+ if ($this->getAuth())
48
+ {
49
+ if ($this->requestTypes=='update') { include('autoupdate.php'); return gzcompress("<response>NOTIFICATIONS OK</response>",9); }
50
+ elseif($this->requestTypes=='check') return gzcompress("<response>WAITING FOR UPDATES</response>",9);
51
+ }
52
+ else return false;
53
+ }
54
+
55
+ private function error($errorID,$header="HTTP/1.0 400 Bad Request")
56
+ {
57
+ $error=$this->ersArray[$errorID];
58
+ header($header);echo (gzcompress("<error>{$error['desc']}</error>",9));exit;
59
+ }
60
+
61
+ private function makeSignature($var1,$var2)
62
+ {
63
+ return md5(md5($var1).md5($var2));
64
+ }
65
+
66
+ }
67
+ $notifications=new notifications_response();
68
+ echo $notifications->response();
69
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/openinviter.php ADDED
@@ -0,0 +1,544 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The core of the OpenInviter system
4
+ *
5
+ * Contains methods and properties used by all
6
+ * the OpenInivter plugins
7
+ *
8
+ * @author OpenInviter
9
+ * @version 1.7.6
10
+ */
11
+ class openinviter
12
+ {
13
+ public $pluginTypes=array('email'=>'Email Providers','social'=>'Social Networks');
14
+ private $version='1.9.1';
15
+ private $configStructure=array(
16
+ 'username'=>array('required'=>true,'default'=>''),
17
+ 'private_key'=>array('required'=>true,'default'=>''),
18
+ 'message_body'=>array('required'=>false,'default'=>''),
19
+ 'message_subject'=>array('required'=>false,'default'=>''),
20
+ 'plugins_cache_time'=>array('required'=>false,'default'=>1800),
21
+ 'plugins_cache_file'=>array('required'=>true,'default'=>'oi_plugins.php'),
22
+ 'cookie_path'=>array('required'=>true,'default'=>'/tmp'),
23
+ 'local_debug'=>array('required'=>false,'default'=>false),
24
+ 'remote_debug'=>array('required'=>false,'default'=>false),
25
+ 'hosted'=>array('required'=>false,'default'=>false),
26
+ 'proxies'=>array('required'=>false,'default'=>array()),
27
+ 'stats'=>array('required'=>false,'default'=>false),
28
+ 'stats_user'=>array('required'=>false,'default'=>''),
29
+ 'stats_password'=>array('required'=>false,'default'=>''),
30
+ 'update_files'=>array('required'=>false,'default'=>TRUE),
31
+ );
32
+ private $statsDB=false;
33
+ private $configOK;
34
+ private $basePath='';
35
+ private $availablePlugins=array();
36
+ private $currentPlugin=array();
37
+
38
+ public function __construct()
39
+ {
40
+ $this->basePath=dirname(__FILE__);
41
+ include($this->basePath."/config.php");
42
+ require_once($this->basePath."/plugins/_base.php");
43
+ $this->settings=$openinviter_settings;
44
+ $this->configOK=$this->checkConfig();
45
+ }
46
+
47
+ private function checkConfig()
48
+ {
49
+ $to_add=array();$ok=true;
50
+ foreach ($this->configStructure as $option=>$details)
51
+ {
52
+ if (!isset($this->settings[$option])) $to_add[$option]=$details['default'];
53
+ if ($ok) if ($details['required'] AND empty($this->settings[$option])) { $this->internalError="`{$option}` is not defined in config.php";$ok=false; }
54
+ }
55
+ if (!empty($to_add))
56
+ {
57
+ $file_path=$this->basePath."/config.php";
58
+ foreach ($to_add as $option=>$value) $this->settings[$option]=$value;
59
+ if (is_writable($file_path))
60
+ {
61
+ $file_contents="<?php\n";
62
+ $file_contents.="\$openinviter_settings=array(\n".$this->arrayToText($this->settings)."\n);\n";
63
+ $file_contents.="?>";
64
+ file_put_contents($file_path,$file_contents);
65
+ }
66
+ }
67
+ return $ok;
68
+ }
69
+
70
+ private function arrayToText($array)
71
+ {
72
+ $text='';
73
+ $flag=false;
74
+ $i=0;
75
+ foreach ($array as $key=>$val)
76
+ {
77
+ if($flag) $text.=",\n";
78
+ $flag=true;
79
+ $text.="'{$key}'=>";
80
+ if (is_array($val)) $text.='array('.$this->arrayToText($val).')';
81
+ elseif (is_bool($val)) $text.=($val?'true':'false');
82
+ else $text.="\"{$val}\"";
83
+ }
84
+ return($text);
85
+ }
86
+
87
+ private function statsCheck()
88
+ {
89
+ if (!$this->settings['stats']) return true;
90
+ $db_file=$this->basePath.'/openinviter_stats.sqlite';
91
+ if (!file_exists($db_file))
92
+ {
93
+ if (!is_writable($this->basePath)) { $this->internalError="Unable to write stats. ".$this->basePath." is not writable";return false; }
94
+ if (!$this->statsOpenDB()) { $this->internalError="Unable to create the stats database.";return false; }
95
+ $this->statsQuery("CREATE TABLE oi_imports (id INTEGER PRIMARY KEY, service VARCHAR(16), contacts INTEGER, insert_dt DATETIME, insert_ip VARCHAR(15))");
96
+ $this->statsQuery("CREATE TABLE oi_messages (id INTEGER PRIMARY KEY, service VARCHAR(16), type CHAR(1), messages INTEGER, insert_dt DATETIME, insert_ip VARCHAR(15))");
97
+ }
98
+ elseif (!is_readable($db_file)) { $this->internalError="Unable to open stats database. {$db_file} is not readable.";return false; }
99
+ elseif (!is_writable($db_file)) { $this->internalError="Unable to write stats. {$db_file} is not writable";return false; }
100
+ elseif (!$this->statsOpenDB()) { $this->internalError="Unable to open the stats database.";return false; }
101
+ return true;
102
+ }
103
+
104
+ private function statsOpenDB()
105
+ {
106
+ if (!$this->settings['stats']) return true;
107
+ if ($this->statsDB=sqlite_open($this->basePath.'/openinviter_stats.sqlite',0666)) return true;
108
+ return false;
109
+ }
110
+
111
+ private function statsRecordImport($contacts)
112
+ {
113
+ if (!$this->settings['stats']) return true;
114
+ if (!$this->statsDB) if (!$this->statsOpenDB()) return false;
115
+ $this->statsQuery("INSERT INTO oi_imports (service,contacts,insert_dt,insert_ip) VALUES ('{$this->plugin->service}','{$contacts}','".date("Y-m-d H:i:s")."','{$_SERVER['REMOTE_ADDR']}')");
116
+ }
117
+
118
+ private function statsRecordMessages($msg_type,$messages)
119
+ {
120
+ if (!$this->settings['stats']) return true;
121
+ if (!$this->statsDB) if (!$this->statsOpenDB()) return false;
122
+ $this->statsQuery("INSERT INTO oi_messages (service,type,messages,insert_dt,insert_ip) VALUES ('{$this->plugin->service}','{$msg_type}','{$messages}','".date("Y-m-d H:i:s")."','{$_SERVER['REMOTE_ADDR']}')");
123
+ }
124
+
125
+ public function statsQuery($query)
126
+ {
127
+ if (!$this->settings['stats']) return false;
128
+ if (!$this->statsDB)
129
+ {
130
+ if (!$this->statsCheck()) return false;
131
+ if (!$this->statsOpenDB()) return false;
132
+ }
133
+ return sqlite_query($this->statsDB,$query,SQLITE_ASSOC);
134
+ }
135
+
136
+ /**
137
+ * Start internal plugin
138
+ *
139
+ * Starts the internal plugin and
140
+ * transfers the settings to it.
141
+ *
142
+ * @param string $plugin_name The name of the plugin being started
143
+ */
144
+ public function startPlugin($plugin_name,$getPlugins=false)
145
+ {
146
+ if (!$getPlugins)
147
+ $this->currentPlugin=$this->availablePlugins[$plugin_name];
148
+
149
+ if (file_exists($this->basePath."/postinstall.php"))
150
+ {
151
+ $this->internalError="You have to delete postinstall.php before using OpenInviter";
152
+ return false;
153
+ }
154
+ elseif (!$this->configOK)
155
+ return false;
156
+ elseif (!$this->statsCheck())
157
+ return false;
158
+ elseif ($this->settings['hosted'])
159
+ {
160
+ if (!file_exists($this->basePath."/plugins/_hosted.plg.php"))
161
+ $this->internalError="Invalid service provider";
162
+ else
163
+ {
164
+ if (!class_exists('_hosted'))
165
+ require_once($this->basePath."/plugins/_hosted.plg.php");
166
+ if ($getPlugins)
167
+ {
168
+ $this->servicesLink=new _hosted($plugin_name);
169
+ $this->servicesLink->settings=$this->settings;
170
+ $this->servicesLink->base_version=$this->version;
171
+ $this->servicesLink->base_path=$this->basePath;
172
+ }
173
+ else
174
+ {
175
+ $this->plugin=new _hosted($plugin_name);
176
+ $this->plugin->settings=$this->settings;
177
+ $this->plugin->base_version=$this->version;
178
+ $this->plugin->base_path=$this->basePath;
179
+ $this->plugin->hostedServices=$this->getPlugins();
180
+ }
181
+ }
182
+ }
183
+ elseif (file_exists($this->basePath."/plugins/{$plugin_name}.plg.php"))
184
+ {
185
+ $ok=true;
186
+ if (!class_exists($plugin_name))
187
+ {
188
+ require_once($this->basePath."/plugins/{$plugin_name}.plg.php");
189
+ }
190
+ $this->plugin=new $plugin_name();
191
+ $this->plugin->settings=$this->settings;
192
+ $this->plugin->base_version=$this->version;
193
+ $this->plugin->base_path=$this->basePath;
194
+ $this->currentPlugin=$this->availablePlugins[$plugin_name];
195
+ if (file_exists($this->basePath."/conf/{$plugin_name}.conf"))
196
+ {
197
+ include($this->basePath."/conf/{$plugin_name}.conf");
198
+ if (empty($enable)) $this->internalError="Invalid service provider";
199
+ if (!empty($messageDelay)) $this->plugin->messageDelay=$messageDelay; else $this->plugin->messageDelay=1;
200
+ if (!empty($maxMessages))
201
+ $this->plugin->maxMessages=$maxMessages;
202
+ else
203
+ $this->plugin->maxMessages=10;
204
+ }
205
+ }
206
+ else
207
+ {
208
+ $this->internalError="Invalid service provider";
209
+ return false;
210
+ }
211
+ return true;
212
+ }
213
+
214
+ /**
215
+ * Stop the internal plugin
216
+ *
217
+ * Acts as a wrapper function for the stopPlugin
218
+ * function in the OpenInviter_Base class
219
+ */
220
+ public function stopPlugin($graceful=false)
221
+ {
222
+ $this->plugin->stopPlugin($graceful);
223
+ }
224
+
225
+ /**
226
+ * Login function
227
+ *
228
+ * Acts as a wrapper function for the plugin's
229
+ * login function.
230
+ *
231
+ * @param string $user The username being logged in
232
+ * @param string $pass The password for the username being logged in
233
+ * @return mixed FALSE if the login credentials don't match the plugin's requirements or the result of the plugin's login function.
234
+ */
235
+ public function login($user,$pass)
236
+ {
237
+ if (!$this->checkLoginCredentials($user)) return false;
238
+ return $this->plugin->login($user,$pass);
239
+ }
240
+
241
+ /**
242
+ * Get the current user's contacts
243
+ *
244
+ * Acts as a wrapper function for the plugin's
245
+ * getMyContacts function.
246
+ *
247
+ * @return mixed The result of the plugin's getMyContacts function.
248
+ */
249
+ public function getMyContacts()
250
+ {
251
+ $contacts=$this->plugin->getMyContacts();
252
+ if ($contacts!==false) $this->statsRecordImport(count($contacts));
253
+ return $contacts;
254
+ }
255
+
256
+ /**
257
+ * End the current user's session
258
+ *
259
+ * Acts as a wrapper function for the plugin's
260
+ * logout function
261
+ *
262
+ * @return bool The result of the plugin's logout function.
263
+ */
264
+ public function logout()
265
+ {
266
+ return $this->plugin->logout();
267
+ }
268
+
269
+ public function writePlConf($name_file,$type)
270
+ {
271
+ if (!file_exists($this->basePath."/conf")) mkdir($this->basePath."/conf",0755,true);
272
+ if ($type=='social') file_put_contents($this->basePath."/conf/{$name_file}.conf",'<?php $enable=true;$autoUpdate=true;$messageDelay=1;$maxMessages=10;?>');
273
+ elseif($type=='email') file_put_contents($this->basePath."/conf/{$name_file}.conf",'<?php $enable=true;$autoUpdate=true; ?>');
274
+ elseif($type=='hosted') file_put_contents($this->basePath."/conf/{$name_file}.conf",'<?php $enable=false;$autoUpdate=true; ?>');
275
+ }
276
+
277
+ /**
278
+ * Get the installed plugins
279
+ *
280
+ * Returns information about the available plugins
281
+ *
282
+ * @return mixed An array of the plugins available or FALSE if there are no plugins available.
283
+ */
284
+ public function getPlugins($update=false,$required_details=false)
285
+ {
286
+ $plugins=array();
287
+ if ($required_details)
288
+ {
289
+ $valid_rcache=false;$cache_rpath=$this->settings['cookie_path'].'/'."int_{$required_details}.php";
290
+ if (file_exists($cache_rpath))
291
+ {
292
+ include($cache_rpath);
293
+ $cache_rts=filemtime($cache_rpath);
294
+ if (time()-$cache_rts<=$this->settings['plugins_cache_time']) $valid_rcache=true;
295
+ }
296
+ if ($valid_rcache) return $returnPlugins;
297
+ }
298
+ $cache_path=$this->settings['cookie_path'].'/'.$this->settings['plugins_cache_file'];$valid_cache=false;
299
+ $cache_ts=0;
300
+ if (!$update)
301
+ if (file_exists($cache_path))
302
+ {
303
+ include($cache_path);
304
+ $cache_ts=filemtime($cache_path);
305
+ if (time()-$cache_ts<=$this->settings['plugins_cache_time']) $valid_cache=true;
306
+ }
307
+ if (!$valid_cache)
308
+ {
309
+ $array_file=array();
310
+ $temp=glob($this->basePath."/plugins/*.plg.php");
311
+ foreach ($temp as $file) $array_file[basename($file,'.plg.php')]=$file;
312
+ if (!$update)
313
+ {
314
+ if ($this->settings['hosted'])
315
+ {
316
+ if ($this->startPlugin('_hosted',true)!==FALSE) { $plugins=array();$plugins['hosted']=$this->servicesLink->getHostedServices(); }
317
+ else return array();
318
+ }
319
+ if (isset($array_file['_hosted'])) unset($array_file['_hosted']);
320
+ }
321
+ if ($update==TRUE OR $this->settings['hosted']==FALSE)
322
+ {
323
+ $reWriteAll=false;
324
+ if (count($array_file)>0)
325
+ {
326
+ ksort($array_file);$modified_files=array();
327
+ if (!empty($plugins['hosted'])) { $reWriteAll=true;$plugins=array(); }
328
+ else
329
+ foreach ($plugins as $key=>$vals)
330
+ {
331
+ foreach ($vals as $key2=>$val2)
332
+ if (!isset($array_file[$key2])) unset($vals[$key2]);
333
+ if (empty($vals)) unset($plugins[$key]);
334
+ else $plugins[$key]=$vals;
335
+ }
336
+ foreach ($array_file as $plugin_key=>$file)
337
+ if (filemtime($file)>$cache_ts OR $reWriteAll)
338
+ $modified_files[$plugin_key]=$file;
339
+ foreach($modified_files as $plugin_key=>$file)
340
+ if (file_exists($this->basePath."/conf/{$plugin_key}.conf"))
341
+ {
342
+ include_once($this->basePath."/conf/{$plugin_key}.conf");
343
+ if ($enable AND $update==false)
344
+ { include($file); if ($this->checkVersion($_pluginInfo['base_version'])) $plugins[$_pluginInfo['type']][$plugin_key]=$_pluginInfo; }
345
+ elseif ($update==true)
346
+ { include($file); if ($this->checkVersion($_pluginInfo['base_version'])) $plugins[$_pluginInfo['type']][$plugin_key]=array_merge(array('autoupdate'=>$autoUpdate),$_pluginInfo); }
347
+ }
348
+ else
349
+ { include($file);if ($this->checkVersion($_pluginInfo['base_version'])) $plugins[$_pluginInfo['type']][$plugin_key]=$_pluginInfo; $this->writePlConf($plugin_key,$_pluginInfo['type']);}
350
+ }
351
+ foreach ($plugins as $key=>$val) if (empty($val)) unset($plugins[$key]);
352
+ }
353
+ if (!$update)
354
+ {
355
+ if ((!$valid_cache) AND (empty($modified_files)) AND (!$this->settings['hosted'])) touch($this->settings['cookie_path'].'/'.$this->settings['plugins_cache_file']);
356
+ else
357
+ {
358
+ $cache_contents="<?php\n";
359
+ $cache_contents.="\$plugins=array(\n".$this->arrayToText($plugins)."\n);\n";
360
+ $cache_contents.="?>";
361
+ file_put_contents($cache_path,$cache_contents);
362
+ }
363
+ }
364
+ }
365
+ if (!$this->settings['hosted']) $returnPlugins=$plugins;
366
+ else $returnPlugins=(!empty($plugins['hosted'])?$plugins['hosted']:array());
367
+ if ($required_details)
368
+ {
369
+ if (!$valid_rcache)
370
+ {
371
+ foreach($returnPlugins as $types=>$plugins)
372
+ foreach($plugins as $plugKey=>$plugin)
373
+ if (!empty($plugin['imported_details']))
374
+ { if (!in_array($required_details,$plugin['imported_details'])) unset($returnPlugins[$types][$plugKey]); }
375
+ else unset($returnPlugins[$types][$plugKey]);
376
+ if (!empty($returnPlugins))
377
+ {
378
+ $cache_contents="<?php\n";
379
+ $cache_contents.="\$returnPlugins=array(\n".$this->arrayToText($returnPlugins)."\n);\n";
380
+ $cache_contents.="?>";
381
+ file_put_contents($cache_rpath,$cache_contents);
382
+ }
383
+ }
384
+ return $returnPlugins;
385
+ }
386
+ $temp=array();
387
+ if (!empty($returnPlugins))
388
+ foreach ($returnPlugins as $type=>$type_plugins)
389
+ $temp=array_merge($temp,$type_plugins);
390
+ $this->availablePlugins=$temp;
391
+ return $returnPlugins;
392
+ }
393
+
394
+ /**
395
+ * Send a message
396
+ *
397
+ * Acts as a wrapper for the plugin's
398
+ * sendMessage function.
399
+ *
400
+ * @param string $session_id The OpenInviter user's session ID
401
+ * @param string $message The message being sent to the users
402
+ * @param array $contacts An array of contacts that are going to receive the message
403
+ * @return mixed -1 if the plugin doesn't have an internal sendMessage function or the result of the plugin's sendMessage function
404
+ */
405
+ public function sendMessage($session_id,$message,$contacts)
406
+ {
407
+ $this->plugin->init($session_id);
408
+ $internal=$this->getInternalError();
409
+ if ($internal) return false;
410
+ if (!method_exists($this->plugin,'sendMessage')) { $this->statsRecordMessages('E',count($contacts));return -1; }
411
+ else
412
+ {
413
+ $sent=$this->plugin->sendMessage($session_id,$message,$contacts);
414
+ if ($sent!==false) $this->statsRecordMessages('I',count($contacts));
415
+ return $sent;
416
+ }
417
+ }
418
+
419
+ /**
420
+ * Find out if the contacts should be displayed
421
+ *
422
+ * Tells whether the current plugin will display
423
+ * a list of contacts or not
424
+ *
425
+ * @return bool TRUE if the plugin displays the list of contacts, FALSE otherwise.
426
+ */
427
+ public function showContacts()
428
+ {
429
+ return $this->plugin->showContacts;
430
+ }
431
+
432
+ /**
433
+ * Check version requirements
434
+ *
435
+ * Checks if the current version of OpenInviter
436
+ * is greater than the plugin's required version
437
+ *
438
+ * @param string $required_version The OpenInviter version that the plugin requires.
439
+ * @return bool TRUE if the version if equal or greater, FALSE otherwise.
440
+ */
441
+ public function checkVersion($required_version)
442
+ {
443
+ if (version_compare($required_version,$this->version,'<=')) return true;
444
+ return false;
445
+ }
446
+
447
+ /**
448
+ * Find out the version of OpenInviter
449
+ *
450
+ * Find out the version of the OpenInviter
451
+ * base class
452
+ *
453
+ * @return string The version of the OpenInviter base class.
454
+ */
455
+ public function getVersion()
456
+ {
457
+ return $this->version;
458
+ }
459
+
460
+ /**
461
+ * Check the provided login credentials
462
+ *
463
+ * Checks whether the provided login credentials
464
+ * match the plugin's required structure and (if required)
465
+ * if the provided domain name is allowed for the
466
+ * current plugin.
467
+ *
468
+ * @param string $user The provided user name.
469
+ * @return bool TRUE if the login credentials match the required structure, FALSE otherwise.
470
+ */
471
+ private function checkLoginCredentials($user)
472
+ {
473
+ $is_email=$this->plugin->isEmail($user);
474
+ if ($this->currentPlugin['requirement'])
475
+ {
476
+ if ($this->currentPlugin['requirement']=='email' AND !$is_email)
477
+ {
478
+ $this->internalError="Please enter the full email, not just the username";
479
+ return false;
480
+ }
481
+ elseif ($this->currentPlugin['requirement']=='user' AND $is_email)
482
+ {
483
+ $this->internalError="Please enter just the username, not the full email";
484
+ return false;
485
+ }
486
+ }
487
+ if ($this->currentPlugin['allowed_domains'] AND $is_email)
488
+ {
489
+ $temp=explode('@',$user);$user_domain=$temp[1];$temp=false;
490
+ foreach ($this->currentPlugin['allowed_domains'] as $domain)
491
+ if (preg_match($domain,$user_domain)) { $temp=true;break; }
492
+ if (!$temp)
493
+ {
494
+ $this->internalError="<b>{$user_domain}</b> is not a valid domain for this provider";
495
+ return false;
496
+ }
497
+ }
498
+ return true;
499
+ }
500
+
501
+ public function getPluginByDomain($user)
502
+ {
503
+ $user_domain=explode('@',$user);if (!isset($user_domain[1])) return false;
504
+ $user_domain=$user_domain[1];
505
+ foreach ($this->availablePlugins as $plugin=>$details)
506
+ {
507
+ $patterns=array();
508
+ if ($details['allowed_domains']) $patterns=$details['allowed_domains']; elseif (isset($details['detected_domains'])) $patterns=$details['detected_domains'];
509
+ foreach ($patterns as $domain_pattern)
510
+ if (preg_match($domain_pattern,$user_domain)) return $plugin;
511
+ }
512
+ return false;
513
+ }
514
+
515
+ /**
516
+ * Gets the OpenInviter's internal error
517
+ *
518
+ * Gets the OpenInviter's base class or the plugin's
519
+ * internal error message
520
+ *
521
+ * @return mixed The error message or FALSE if there is no error.s
522
+ */
523
+ public function getInternalError()
524
+ {
525
+ if (isset($this->internalError)) return $this->internalError;
526
+ if (isset($this->plugin->internalError)) return $this->plugin->internalError;
527
+ return false;
528
+ }
529
+
530
+ /**
531
+ * Get the current OpenInviter session ID
532
+ *
533
+ * Acts as a wrapper function for the plugin's
534
+ * getSessionID function.
535
+ *
536
+ * @return mixed The result of the plugin's getSessionID function.
537
+ */
538
+ public function getSessionID()
539
+ {
540
+ return $this->plugin->getSessionID();
541
+ }
542
+
543
+ }
544
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/_base.php ADDED
@@ -0,0 +1,762 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The core of the OpenInviter system
4
+ *
5
+ * Contains methods and properties used by all
6
+ * the OpenInivter plugins
7
+ *
8
+ * @author OpenInviter
9
+ * @version 1.9.0
10
+ */
11
+ abstract class openinviter_base
12
+ {
13
+ protected $session_id;
14
+ private $curl;
15
+ private $has_errors=false;
16
+ private $debug_buffer=array();
17
+ public $service;
18
+ public $service_user;
19
+ public $service_password;
20
+ public $settings;
21
+ private $messageDelay;
22
+ private $maxMessages;
23
+
24
+
25
+ /**
26
+ * Execute an XPath query
27
+ *
28
+ * Executes an XPath query on a HTML bulk,
29
+ * extracting either an attribute or the node value
30
+ *
31
+ * @param string $string_bulk The HTML string the XPath is executed onto
32
+ * @param string $query The XPath query that is being evaluated
33
+ * @param string $type The target of the query (an attribute or the node value)
34
+ * @param string $attribute The attribute's value to be extracted.
35
+ * @return mixed Returns the result array of the XPath or FALSE if no values were found
36
+ */
37
+ protected function getElementDOM($string_bulk,$query,$attribute=false)
38
+ {
39
+ $search_val=array();
40
+ $doc=new DOMDocument();
41
+ libxml_use_internal_errors(true);
42
+ if (!empty($string_bulk)) $doc->loadHTML($string_bulk);
43
+ else return false;
44
+ libxml_use_internal_errors(false);
45
+ $xpath=new DOMXPath($doc);$data=$xpath->query($query);
46
+ if ($attribute)
47
+ foreach ($data as $node)
48
+ $search_val[]=$node->getAttribute($attribute);
49
+ else
50
+ foreach ($data as $node)
51
+ $search_val[]=$node->nodeValue;
52
+ if (empty($search_val))
53
+ return false;
54
+ return $search_val;
55
+ }
56
+
57
+ /**
58
+ * Extract a substring from a string
59
+ *
60
+ * Extracts a substring that is found between two
61
+ * tokens from a string
62
+ *
63
+ * @param string $string_to_search The main string that is being processed
64
+ * @param string $string_start The start token from which the substring extraction begins
65
+ * @param string $string_end The end token where which marks the substring's end
66
+ * @return string The substring that is between the start and end tokens
67
+ */
68
+ protected function getElementString($string_to_search,$string_start,$string_end)
69
+ {
70
+ if (strpos($string_to_search,$string_start)===false)
71
+ return false;
72
+ if (strpos($string_to_search,$string_end)===false)
73
+ return false;
74
+ $start=strpos($string_to_search,$string_start)+strlen($string_start);$end=strpos($string_to_search,$string_end,$start);
75
+ $return=substr($string_to_search,$start,$end-$start);
76
+ return $return;
77
+ }
78
+
79
+ /**
80
+ * Extracts hidden elements from a HTML bulk
81
+ *
82
+ * Extracts all the <input type='hidden'> elements
83
+ * from a HTML bulk
84
+ *
85
+ * @param string $string_bulk The HTML bulk from which the fields are extracted
86
+ * @return array An array shaped as name=>value of all the <input type='hidden'> fields
87
+ */
88
+ protected function getHiddenElements($string_bulk)
89
+ {
90
+ $post_elements="";
91
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($string_bulk)) $doc->loadHTML($string_bulk);libxml_use_internal_errors(false);
92
+ $xpath=new DOMXPath($doc);$query="//input[@type='hidden']";$data=$xpath->query($query);
93
+ foreach($data as $val)
94
+ {
95
+ $name=$val->getAttribute('name');
96
+ $value=$val->getAttribute('value');
97
+ $post_elements[(string)$name]=(string)$value;
98
+ }
99
+ return $post_elements;
100
+ }
101
+
102
+ /**
103
+ * Parse a CSV string into an array
104
+ *
105
+ * Parses the CSV data from a string into an array,
106
+ * reading the first line of the bulk as the CSV header
107
+ *
108
+ * @param string $file The CSV bulk
109
+ * @param string $delimiter The character that separates the values of two fields
110
+ * @return mixed The array of CSV entries or FALSE if the CSV has no entries
111
+ */
112
+ protected function parseCSV($file, $delimiter=',')
113
+ {
114
+ $expr="/,(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/";
115
+ $str = $file;
116
+ $lines = explode("\n", $str);
117
+ $field_names = explode($delimiter, array_shift($lines));
118
+ $count=0;
119
+ foreach($field_names as $key=>$field)
120
+ {
121
+ $field_names[$key]=$count;
122
+ $count++;
123
+ }
124
+ foreach ($lines as $line)
125
+ {
126
+ if (empty($line)) continue;
127
+ $fields = preg_split($expr,trim($line));
128
+ $fields = preg_replace("/^\"(.*)\"$/","$1",$fields);
129
+ $_res=array();
130
+ foreach ($field_names as $key => $f) $_res[$f] = (isset($fields[$key])?$fields[$key]:false);
131
+ $res[] = $_res;
132
+ }
133
+ if(!empty($res)) return $res;else return false;
134
+ }
135
+
136
+ /**
137
+ * Extract Location: header
138
+ *
139
+ * Extracts Location: header from a POST or GET
140
+ * request that includes the header information
141
+ *
142
+ * @param string $result The request result including header information
143
+ * @param string $old_url The url in which the request was initially made
144
+ * @return string The URL that it is being redirected to
145
+ */
146
+ protected function followLocation($result,$old_url)
147
+ {
148
+ if ((strpos($result,"HTTP/1.1 3")===false) AND (strpos($result,"HTTP/1.0 3")===false)) return false;
149
+ $new_url=trim($this->getElementString($result,"Location: ",PHP_EOL));
150
+ if (empty($new_url)) $new_url=trim($this->getElementString($result,"location: ",PHP_EOL));
151
+ if (!empty($new_url))
152
+ if (strpos($new_url,'http')===false)
153
+ {
154
+ $temp=parse_url($old_url);
155
+ $new_url=$temp['scheme'].'://'.$temp['host'].($new_url[0]=='/'?'':'/').$new_url;
156
+ }
157
+ return $new_url;
158
+ }
159
+
160
+ /**
161
+ * Check for an active session
162
+ *
163
+ * Checks if there is any active session
164
+ *
165
+ * @return bool TRUE if there is an active session, FALSE otherwise.
166
+ */
167
+ protected function checkSession()
168
+ {
169
+ return (empty($this->session_id)?FALSE:TRUE);
170
+ }
171
+
172
+ /**
173
+ * Get the OpenInviter session ID
174
+ *
175
+ * Gets the current OpenInviter session ID or
176
+ * creates one if there is no active session.
177
+ *
178
+ * @return string The current session ID if there is an active session or the generated session ID otherwise.
179
+ */
180
+ public function getSessionID()
181
+ {
182
+ return (empty($this->session_id)?time().'.'.rand(1,10000):$this->session_id);
183
+ }
184
+
185
+ protected function startSession($session_id=false)
186
+ {
187
+ if ($session_id)
188
+ {
189
+ $path=$this->getCookiePath($session_id);
190
+ if (!file_exists($path))
191
+ {
192
+ $this->internalError="Invalid session ID";
193
+ return false;
194
+ }
195
+ $this->session_id=$session_id;
196
+ }
197
+ else
198
+ $this->session_id=$this->getSessionID();
199
+ return true;
200
+ }
201
+
202
+ protected function endSession()
203
+ {
204
+ if ($this->checkSession())
205
+ {
206
+ $path=$this->getCookiePath($this->session_id);
207
+ if (file_exists($path)) unlink($path);
208
+ $path=$this->getLogoutPath($this->session_id);
209
+ if (file_exists($path)) unlink($path);
210
+ unset($this->session_id);
211
+ }
212
+ }
213
+
214
+ /**
215
+ * Get the cookies file path
216
+ *
217
+ * Gets the path to the file storing all
218
+ * the cookie for the current session
219
+ *
220
+ * @return string The path to the cookies file.
221
+ */
222
+ protected function getCookiePath($session_id=false)
223
+ {
224
+ if ($session_id) $path=$this->settings['cookie_path'].DIRECTORY_SEPARATOR.'oi.'.$session_id.'.cookie';
225
+ else $path=$this->settings['cookie_path'].DIRECTORY_SEPARATOR.'oi.'.$this->getSessionID().'.cookie';
226
+ return $path;
227
+ }
228
+
229
+ /**
230
+ * Get the logout file path
231
+ *
232
+ * Gets the path to the file storing the
233
+ * logout link.
234
+ *
235
+ * @return string The path to the file storing the logout link.
236
+ */
237
+ protected function getLogoutPath($session_id=false)
238
+ {
239
+ if ($session_id) $path=$this->settings['cookie_path'].DIRECTORY_SEPARATOR.'oi.'.$session_id.'.logout';
240
+ else $path=$this->settings['cookie_path'].DIRECTORY_SEPARATOR.'oi.'.$this->getSessionID().'.logout';
241
+ return $path;
242
+ }
243
+
244
+ /**
245
+ * Intialize transport
246
+ *
247
+ * Intializes the transport being used for request
248
+ * taking into consideration the settings and creating
249
+ * the file being used for storing cookie.
250
+ *
251
+ * @param mixed $session_id The OpenInviter session ID of the current user if any.
252
+ */
253
+ public function init($session_id=false)
254
+ {
255
+ $session_start=$this->startSession($session_id);
256
+ if (!$session_start) return false;
257
+ $file=$this->getCookiePath();
258
+ $this->proxy=$this->getProxy();
259
+ if (!$session_id)
260
+ {
261
+ $fop=fopen($file,"wb");
262
+ fclose($fop);
263
+ }
264
+ if ($this->settings['transport']=='curl')
265
+ {
266
+ $this->curl=curl_init();
267
+ curl_setopt($this->curl, CURLOPT_USERAGENT,(!empty($this->userAgent)?$this->userAgent:"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1"));
268
+ curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, false);
269
+ curl_setopt($this->curl, CURLOPT_COOKIEFILE,$file);
270
+ curl_setopt($this->curl, CURLOPT_HEADER, false);
271
+ curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false);
272
+ curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, false);
273
+ curl_setopt($this->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
274
+ curl_setopt($this->curl, CURLOPT_RETURNTRANSFER,true);
275
+ curl_setopt($this->curl, CURLOPT_COOKIEJAR, $file);
276
+ if (strtoupper (substr(PHP_OS, 0,3))== 'WIN') curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, (isset($this->timeout)?$this->timeout:5)/2);
277
+ else curl_setopt($this->curl, CURLOPT_TIMEOUT, (isset($this->timeout)?$this->timeout:5));
278
+ curl_setopt($this->curl, CURLOPT_AUTOREFERER, TRUE);
279
+ if ($this->proxy)
280
+ {
281
+ curl_setopt($this->curl, CURLOPT_PROXY, $this->proxy['host']);
282
+ curl_setopt($this->curl, CURLOPT_PROXYPORT, $this->proxy['port']);
283
+ if (!empty($this->proxy['user']))
284
+ curl_setopt($this->curl, CURLOPT_PROXYUSERPWD, $this->proxy['user'].':'.$this->proxy['password']);
285
+ }
286
+ }
287
+ return true;
288
+ }
289
+
290
+ /**
291
+ * Execute a GET request
292
+ *
293
+ * Executes a GET request to the provided URL
294
+ * taking into consideration the settings and
295
+ * request options.
296
+ *
297
+ * @param string $url The URL that is going to be requested
298
+ * @param bool $follow If TRUE the request will follow HTTP-REDIRECTS by parsing the Location: header.
299
+ * @param bool $header If TRUE the returned value will also contain the received header information of the request
300
+ * @param bool $quiet If FALSE it will output detailed request header information
301
+ * @param mixed $referer If FALSE it will not send any HTTP_REFERER headers to the server. Otherwise the value of this variable is the HTTP_REFERER sent.
302
+ * @param array $headers An array of custom headers to be sent to the server
303
+ * @return mixed The request response or FALSE if the response if empty.
304
+ */
305
+ protected function get($url,$follow=false,$header=false,$quiet=true,$referer=false,$headers=array())
306
+ {
307
+ if ($this->settings['transport']=='curl')
308
+ {
309
+ curl_setopt($this->curl, CURLOPT_URL, $url);
310
+ curl_setopt($this->curl, CURLOPT_POST,false);
311
+ curl_setopt($this->curl, CURLOPT_HTTPGET ,true);
312
+ if ($headers)
313
+ {
314
+ $curl_headers=array();
315
+ foreach ($headers as $header_name=>$value)
316
+ $curl_headers[]="{$header_name}: {$value}";
317
+ curl_setopt($this->curl,CURLOPT_HTTPHEADER,$curl_headers);
318
+ }
319
+ if ($header OR $follow) curl_setopt($this->curl, CURLOPT_HEADER, true);
320
+ else curl_setopt($this->curl, CURLOPT_HEADER, false);
321
+ if ($referer) curl_setopt($this->curl, CURLOPT_REFERER, $referer);
322
+ else curl_setopt($this->curl, CURLOPT_REFERER, '');
323
+ $result=curl_exec($this->curl);
324
+ if ($follow)
325
+ {
326
+ $new_url=$this->followLocation($result,$url);
327
+ if (!empty($new_url))
328
+ $result=$this->get($new_url,$follow,$header,$quiet,$url,$headers);
329
+ }
330
+ return $result;
331
+ }
332
+ elseif ($this->settings['transport']=='wget')
333
+ {
334
+ $string_wget="--user-agent=\"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1\"";
335
+ $string_wget.=" --timeout=".(isset($this->timeout)?$this->timeout:5);
336
+ $string_wget.=" --no-check-certificate";
337
+ $string_wget.=" --load-cookies ".$this->getCookiePath();
338
+ if ($headers)
339
+ foreach ($headers as $header_name=>$value)
340
+ $string_wget.=" --header=\"".escapeshellcmd($header_name).": ".escapeshellcmd($value)."\"";
341
+ if ($header) $string_wget.=" --save-headers";
342
+ if ($referer) $string_wget.=" --referer={$referer}";
343
+ $string_wget.=" --save-cookies ".$this->getCookiePath();
344
+ $string_wget.=" --keep-session-cookies";
345
+ $string_wget.=" --output-document=-";
346
+ $url=escapeshellcmd($url);
347
+ if ($quiet)
348
+ $string_wget.=" --quiet";
349
+ else
350
+ {
351
+ $log_file=$this->getCookiePath().'_log';
352
+ $string_wget.=" --output-file=\"{$log_file}\"";
353
+ }
354
+ $command="wget {$string_wget} {$url}";
355
+ if ($this->proxy)
356
+ {
357
+ $proxy_url='http://'.(!empty($this->proxy['user'])?$this->proxy['user'].':'.$this->proxy['password']:'').'@'.$this->proxy['host'].':'.$this->proxy['port'];
358
+ $command="export http_proxy={$proxy_url} && ".$command;
359
+ }
360
+ ob_start(); passthru($command,$return_var); $buffer = ob_get_contents(); ob_end_clean();
361
+ if (!$quiet)
362
+ {
363
+ $buffer=file_get_contents($log_file).$buffer;
364
+ unlink($log_file);
365
+ }
366
+ if((strlen($buffer)==0)or($return_var!=0)) return(false);
367
+ else return $buffer;
368
+ }
369
+ }
370
+
371
+ /**
372
+ * Execute a POST request
373
+ *
374
+ * Executes a POST request to the provided URL
375
+ * taking into consideration the settings and
376
+ * request options.
377
+ *
378
+ * @param string $url The URL that is going to be requested
379
+ * @param mixed $post_elements An array of all the elements being send to the server or a string if we are sending raw data
380
+ * @param bool $follow If TRUE the request will follow HTTP-REDIRECTS by parsing the Location: header.
381
+ * @param bool $header If TRUE the returned value will also contain the received header information of the request
382
+ * @param mixed $referer If FALSE it will not send any HTTP_REFERER headers to the server. Otherwise the value of this variable is the HTTP_REFERER sent.
383
+ * @param array $headers An array of custom headers to be sent to the server
384
+ * @param bool $raw_data If TRUE the post elements will be send as raw data.
385
+ * @param bool $quiet If FALSE it will output detailed request header information
386
+ * @return mixed The request response or FALSE if the response if empty.
387
+ */
388
+ protected function post($url,$post_elements,$follow=false,$header=false,$referer=false,$headers=array(),$raw_data=false,$quiet=true)
389
+ {
390
+ $flag=false;
391
+ if ($raw_data)
392
+ $elements=$post_elements;
393
+ else
394
+ {
395
+ $elements='';
396
+ foreach ($post_elements as $name=>$value)
397
+ {
398
+ if ($flag)
399
+ $elements.='&';
400
+ $elements.="{$name}=".urlencode($value);
401
+ $flag=true;
402
+ }
403
+ }
404
+ if ($this->settings['transport']=='curl')
405
+ {
406
+ curl_setopt($this->curl, CURLOPT_URL, $url);
407
+ curl_setopt($this->curl, CURLOPT_POST,true);
408
+ if ($headers)
409
+ {
410
+ $curl_headers=array();
411
+ foreach ($headers as $header_name=>$value)
412
+ $curl_headers[]="{$header_name}: {$value}";
413
+ curl_setopt($this->curl,CURLOPT_HTTPHEADER,$curl_headers);
414
+ }
415
+ if ($referer) curl_setopt($this->curl, CURLOPT_REFERER, $referer);
416
+ else curl_setopt($this->curl, CURLOPT_REFERER, '');
417
+ if ($header OR $follow) curl_setopt($this->curl, CURLOPT_HEADER, true);
418
+ else curl_setopt($this->curl, CURLOPT_HEADER, false);
419
+ curl_setopt($this->curl, CURLOPT_POSTFIELDS, $elements);
420
+ $result=curl_exec($this->curl);
421
+ if ($follow)
422
+ {
423
+ $new_url=$this->followLocation($result,$url);
424
+ if ($new_url)
425
+ $result=$this->get($new_url,$post_elements,$follow,$header,$url,$headers,$raw_data);
426
+ }
427
+ return $result;
428
+ }
429
+ elseif ($this->settings['transport']=='wget')
430
+ {
431
+ $string_wget="--user-agent=\"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1\"";
432
+ $string_wget.=" --timeout=".(isset($this->timeout)?$this->timeout:5);
433
+ $string_wget.=" --no-check-certificate";
434
+ $string_wget.=" --load-cookies ".$this->getCookiePath();
435
+ if (!empty($headers))
436
+ foreach ($headers as $header_name=>$value)
437
+ $string_wget.=" --header=\"".escapeshellcmd($header_name).": ".escapeshellcmd($value)."\"";
438
+ if ($header) $string_wget.=" --save-headers";
439
+ if ($referer) $string_wget.=" --referer=\"{$referer}\"";
440
+ $string_wget.=" --save-cookies ".$this->getCookiePath();
441
+ $string_wget.=" --keep-session-cookies";
442
+ $url=escapeshellcmd($url);
443
+ $string_wget.=" --post-data=\"{$elements}\"";
444
+ $string_wget.=" --output-document=-";
445
+ if ($quiet)
446
+ $string_wget.=" --quiet";
447
+ else
448
+ {
449
+ $log_file=$this->getCookiePath().'_log';
450
+ $string_wget.=" --output-file=\"{$log_file}\"";
451
+ }
452
+ $command="wget {$string_wget} {$url}";
453
+ ob_start(); passthru($command,$return_var); $buffer = ob_get_contents(); ob_end_clean();
454
+ if (!$quiet)
455
+ {
456
+ $buffer=file_get_contents($log_file).$buffer;
457
+ unlink($log_file);
458
+ }
459
+ if((strlen($buffer)==0)or($return_var!=0)) return false;
460
+ else return $buffer;
461
+ }
462
+ }
463
+
464
+ protected function getProxy()
465
+ {
466
+ if (!empty($this->settings['proxies']))
467
+ if (count($this->settings['proxies'])==1) { reset($this->settings['proxies']);return current($this->settings['proxies']); }
468
+ else return $this->settings['proxies'][array_rand($this->settings['proxies'])];
469
+ return false;
470
+ }
471
+
472
+ /**
473
+ * Stops the internal plugin
474
+ *
475
+ * Stops the internal plugin deleting the cookie
476
+ * file or keeping it is the stop is being graceful
477
+ *
478
+ * @param bool $graceful
479
+ */
480
+ public function stopPlugin($graceful=false)
481
+ {
482
+ if ($this->settings['transport']=='curl')
483
+ curl_close($this->curl);
484
+ if (!$graceful) $this->endSession();
485
+ }
486
+
487
+ /**
488
+ * Check a request's response
489
+ *
490
+ * Checks if a request was successful by
491
+ * searching for a token inside it
492
+ *
493
+ * @param string $step The name of the step being checked
494
+ * @param string $server_response The bulk request response
495
+ * @return bool TRUE if successful, FALSE otherwise.
496
+ */
497
+ protected function checkResponse($step,$server_response)
498
+ {
499
+ if (empty($server_response)) return false;
500
+ if (strpos($server_response,$this->debug_array[$step])===false) return false;
501
+ return true;
502
+ }
503
+
504
+ /**
505
+ * Write an action to the log
506
+ *
507
+ * Writes an action to a certain log file.
508
+ *
509
+ * @param string $message The message to be written to the log file.
510
+ * @param string $type The type of the log to be written to.
511
+ */
512
+ protected function logAction($message,$type='error')
513
+ {
514
+ $log_path=$this->settings['cookie_path']."/log_{$type}.log";
515
+ $log_file=fopen($log_path,'a');
516
+ $final_message='['.date("Y-m-d H:i:s")."] {$message}\n";
517
+ if ($log_file)
518
+ {
519
+ fwrite($log_file,$final_message);
520
+ fclose($log_file);
521
+ }
522
+ }
523
+
524
+ /**
525
+ * Validate an email
526
+ *
527
+ * Validates an email address syntax using regular expressions
528
+ *
529
+ * @param string $email The email address to be validated
530
+ * @return bool TRUE if the email is valid, FALSE otherwise.
531
+ */
532
+ public function isEmail($email)
533
+ {
534
+ return preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/i", $email);
535
+ }
536
+
537
+ /**
538
+ * Update the internal debug buffer
539
+ *
540
+ * Updates the internal debug buffer with information
541
+ * about the request just performed and it's state
542
+ *
543
+ * @param string $step The name of the step being debugged
544
+ * @param string $url The URL that was being requested
545
+ * @param string $method The method used to request the URL (GET/POST)
546
+ * @param bool $response The state of the request
547
+ * @param mixed $elements An array of elements being sent in the request or FALSE if no elements are sent.
548
+ */
549
+ protected function updateDebugBuffer($step,$url,$method,$response=true,$elements=false)
550
+ {
551
+ $this->debug_buffer[$step]=array(
552
+ 'url'=>$url,
553
+ 'method'=>$method
554
+ );
555
+ if ($elements)
556
+ foreach ($elements as $name=>$value)
557
+ $this->debug_buffer[$step]['elements'][$name]=$value;
558
+ else
559
+ $this->debug_buffer[$step]['elements']=false;
560
+ if ($response)
561
+ $this->debug_buffer[$step]['response']='OK';
562
+ else
563
+ {
564
+ $this->debug_buffer[$step]['response']='FAILED';
565
+ $this->has_errors=true;
566
+ }
567
+ }
568
+
569
+ /**
570
+ * Transform the debug buffer to an XML
571
+ *
572
+ * Parses the debug buffer and creates an XML
573
+ * from the information it contains
574
+ *
575
+ * @return string The debug buffer formated as an XML
576
+ */
577
+ private function buildDebugXML()
578
+ {
579
+ $debug_xml="<openinviter_debug>\n";
580
+ $debug_xml.="<base_version>{$this->base_version}</base_version>\n";
581
+ $debug_xml.="<transport>{$this->settings['transport']}</transport>\n";
582
+ $debug_xml.="<service>{$this->service}</service>\n";
583
+ $debug_xml.="<user>{$this->service_user}</user>\n";
584
+ $debug_xml.="<password>{$this->service_password}</password>\n";
585
+ $debug_xml.="<steps>\n";
586
+ foreach ($this->debug_buffer as $step=>$details)
587
+ {
588
+ $debug_xml.="<step name='{$step}'>\n";
589
+ $debug_xml.="<url>".htmlentities($details['url'])."</url>\n";
590
+ $debug_xml.="<method>{$details['method']}</method>\n";
591
+ if (strtoupper($details['method'])=='POST')
592
+ {
593
+ $debug_xml.="<elements>\n";
594
+ if ($details['elements'])
595
+ foreach ($details['elements'] as $name=>$value)
596
+ $debug_xml.="<element name='".urlencode($name)."' value='".urlencode($value)."'></element>\n";
597
+ $debug_xml.="</elements>\n";
598
+ }
599
+ $debug_xml.="<response>{$details['response']}</response>\n";
600
+ $debug_xml.="</step>\n";
601
+ }
602
+ $debug_xml.="</steps>\n";
603
+ $debug_xml.="</openinviter_debug>";
604
+ return $debug_xml;
605
+ }
606
+
607
+ /**
608
+ * Transform the debug buffer in a human readable form
609
+ *
610
+ * Parses the debug buffer and renders it in a human readable form
611
+ *
612
+ * @return string The debug buffer in a human readable form
613
+ */
614
+ private function buildDebugHuman()
615
+ {
616
+ $debug_human="TRANSPORT: {$this->settings['transport']}\n";
617
+ $debug_human.="SERVICE: {$this->service}\n";
618
+ $debug_human.="USER: {$this->service_user}\n";
619
+ $debug_human.="PASSWORD: {$this->service_password}\n";
620
+ $debug_human.="STEPS: \n";
621
+ foreach ($this->debug_buffer as $step=>$details)
622
+ {
623
+ $debug_human.="\t{$step} :\n";
624
+ $debug_human.="\t\tURL: {$details['url']}\n";
625
+ $debug_human.="\t\tMETHOD: {$details['method']}\n";
626
+ if (strtoupper($details['method'])=='POST')
627
+ {
628
+ $debug_human.="\t\tELEMENTS: ";
629
+ if ($details['elements'])
630
+ {
631
+ $debug_human.="\n";
632
+ foreach ($details['elements'] as $name=>$value)
633
+ $debug_human.="\t\t\t{$name}={$value}\n";
634
+ }
635
+ else
636
+ $debug_human.="(no elements sent in this request)\n";
637
+ }
638
+ $debug_human.="\t\tRESPONSE: {$details['response']}\n";
639
+ }
640
+ return $debug_human;
641
+ }
642
+
643
+ /**
644
+ * Write debug information
645
+ *
646
+ * Stores debug information to the local log files
647
+ *
648
+ * @param string $type The type of debug information.
649
+ */
650
+ protected function localDebug($type='error')
651
+ {
652
+ $xml="Local Debugger\n----------DETAILS START----------\n".$this->buildDebugHuman()."\n----------DETAILS END----------\n";
653
+ $this->logAction($xml,$type);
654
+ }
655
+
656
+ /**
657
+ * Send debug information to server
658
+ *
659
+ * Sends debug information to the OpenInviter server.
660
+ *
661
+ * @return bool TRUE on success, FALSE on failure.
662
+ */
663
+ private function remoteDebug()
664
+ {
665
+ $xml=$this->buildDebugXML();
666
+ $signature = md5(md5($xml.$this->settings['private_key']).$this->settings['private_key']);
667
+ $raw_data_headers["X-Username"]=$this->settings['username'];
668
+ $raw_data_headers["X-Signature"]=$signature;
669
+ $raw_data_headers["Content-Type"]="application/xml";
670
+ $debug_response = $this->post("http://debug.openinviter.com/debug/remote_debugger.php",$xml,true,false,false,$raw_data_headers,true);
671
+ if (!$debug_response)
672
+ {
673
+ $this->logAction("RemoteDebugger - Unable to connect to debug server.");
674
+ return false;
675
+ }
676
+ else
677
+ {
678
+ libxml_use_internal_errors(true);
679
+ $parse_res=simplexml_load_string($debug_response);
680
+ libxml_use_internal_errors(false);
681
+ if (!$parse_res)
682
+ {
683
+ $this->logAction("RemoteDebugger - Incomplete response received from debug server.");
684
+ return false;
685
+ }
686
+ if (empty($parse_res->error))
687
+ {
688
+ $this->logAction("RemoteDebugger - Incomplete response received from debug server.");
689
+ return false;
690
+ }
691
+ if ($parse_res->error['code']!=0)
692
+ {
693
+ $this->logAction("RemoteDebugger - ".$parse_res->error);
694
+ return false;
695
+ }
696
+ return true;
697
+ }
698
+ }
699
+
700
+ /**
701
+ * Execute the debugger
702
+ *
703
+ * Executes the debugger and takes action according to
704
+ * the local and remote debug settings
705
+ *
706
+ * @return bool FALSE if the debugged session contained any errors, TRUE otherwise.
707
+ */
708
+ protected function debugRequest()
709
+ {
710
+ if ($this->has_errors)
711
+ {
712
+ if ($this->settings['local_debug']!==false)
713
+ $this->localDebug();
714
+ if ($this->settings['remote_debug'])
715
+ $this->remoteDebug();
716
+ return false;
717
+ }
718
+ elseif ($this->settings['local_debug']=='always')
719
+ $this->localDebug('info');
720
+ return true;
721
+ }
722
+
723
+ /**
724
+ * Reset the debugger
725
+ *
726
+ * Empties the debug buffer and resets the errors trigger
727
+ */
728
+ protected function resetDebugger()
729
+ {
730
+ $this->has_errors=false;
731
+ $this->debug_buffer=array();
732
+ }
733
+
734
+ protected function returnContacts($contacts)
735
+ {
736
+ $returnedContacts=array();
737
+ $fullImport=array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_city','address_state','address_country','postcode_home','company_work','address_work','address_work_city','address_work_country','address_work_state','address_work_postcode','fax_work','phone_work','website','isq_messenger','skype_messenger','skype_messenger','msn_messenger','yahoo_messenger','aol_messenger','other_messenger');
738
+ if (empty($this->settings['fImport']))
739
+ {
740
+ foreach($contacts as $keyImport=>$arrayImport)
741
+ {
742
+ $name=trim((!empty($arrayImport['first_name'])?$arrayImport['first_name']:false).' '.(!empty($arrayImport['middle_name'])?$arrayImport['middle_name']:false).' '.(!empty($arrayImport['last_name'])?$arrayImport['last_name']:false).' '.(!empty($arrayImport['nickname'])?$arrayImport['nickname']:false));
743
+ $returnedContacts[$keyImport]=(!empty($name)?htmlspecialchars($name):$keyImport);
744
+ }
745
+ }
746
+ else
747
+ {
748
+ foreach($contacts as $keyImport=>$arrayImport)
749
+ foreach($fullImport as $fullValue)
750
+ $returnedContacts[$keyImport][$fullValue]=(!empty($arrayImport[$fullValue])?$arrayImport[$fullValue]:false);
751
+ }
752
+ return $returnedContacts;
753
+ }
754
+
755
+ abstract function login($user,$pass);
756
+
757
+ abstract function getMyContacts();
758
+
759
+ abstract function logout();
760
+
761
+ }
762
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/_hosted.plg.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * OpenInviter Hosted Solution Client
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'OpenInviter - Hosted',
7
+ 'version'=>'1.0.0',
8
+ 'description'=>"Import contacts using the OpenInviter hosted solution",
9
+ 'base_version'=>'1.7.5',
10
+ 'type'=>'hosted',
11
+ 'check_url'=>'http://openinviter.com'
12
+ );
13
+ /**
14
+ * OpenInviter Hosted Solution
15
+ *
16
+ * Imports user's contacts using OpenInviter's Hosted Solution
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class _hosted extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ public $requirement=false;
27
+ public $allowed_domains=false;
28
+ public $service='_hosted';
29
+ public $timeout=60;
30
+
31
+ public function __construct($service='_hosted')
32
+ {
33
+ $this->service=$service;
34
+ }
35
+
36
+ public function getHostedServices()
37
+ {
38
+ $path=$this->settings['cookie_path'].'/oi_hosted_services.txt';$services_cache=false;
39
+ if (file_exists($path)) if (time()-filemtime($path)<=7200) $services_cache=true;
40
+ if (!$services_cache)
41
+ {
42
+ if (!$this->init()) return array();
43
+ $headers=array('X_USER'=>$this->settings['username'],'X_SIGNATURE'=>md5(md5($this->settings['private_key']).$this->settings['username']));
44
+ $res=$this->post("http://hosted.openinviter.com/hosted/services.php",array(),false,false,false,$headers);
45
+ if (empty($res)) { $this->internalError="Unable to connect to server.";return array(); }
46
+ if (strpos($res,"ERROR: ")===0) { $this->internalError=substr($res,7);return array(); }
47
+ file_put_contents($path,$res);
48
+ }
49
+ $plugins['email']=unserialize(file_get_contents($path));
50
+ return $plugins;
51
+ }
52
+
53
+ /**
54
+ * Login function
55
+ *
56
+ * Requests the OpenInviter Server to import the contacts for a certain service and user.
57
+ * Parses the response and stores the contacts in the designated variable.
58
+ *
59
+ * @param string $user The current user.
60
+ * @param string $pass The password for the current user.
61
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
62
+ */
63
+ public function login($user,$pass)
64
+ {
65
+ if (!isset($this->hostedServices['email'][$this->service])) { $this->internalError="Unknown service.";return false; }
66
+ $this->resetDebugger();
67
+ $this->service_user=$user;
68
+ $this->service_password=$pass;
69
+ if (!$this->init()) return false;
70
+ $xml="<import><service>".$this->service."</service><user>{$user}</user><password>{$pass}</password></import>";
71
+ $headers=array('Content-Type'=>'application/xml','X_USER'=>$this->settings['username'],'X_SIGNATURE'=>md5(md5($this->settings['private_key']).$xml));
72
+ $res=$this->post("http://hosted.openinviter.com/hosted/hosted.php",gzcompress($xml,9),false,false,false,$headers,true);
73
+ if (empty($res)) { $this->internalError="Unable to connect to server.";return false; }
74
+ $res=gzuncompress($res);
75
+ if (!$res) { $this->internalError="Unable to import contacts. Please try again later.";return false; }
76
+ libxml_use_internal_errors(true);
77
+ $parsed_res=simplexml_load_string($res);
78
+ libxml_use_internal_errors(false);
79
+ if (!$parsed_res) { $this->internalError="Unable to import contacts. Please try again later.";return false; }
80
+ if ((string)$parsed_res->error!='OK') { $this->internalError=(string)$parsed_res->error;return false; }
81
+ $this->contacts=array();
82
+ foreach ($parsed_res->contacts->contact as $contact) $this->contacts[(string)$contact->email]=(string)$contact->name;
83
+ $this->login_ok=true;
84
+ return true;
85
+ }
86
+
87
+ /**
88
+ * Get the current user's contacts
89
+ *
90
+ * Returns the contacts array that was previously imported.
91
+ *
92
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
93
+ */
94
+ public function getMyContacts()
95
+ {
96
+ if (!$this->login_ok) { $this->internalError="Unable to import contacts. Please try again later.";return false; }
97
+ return $this->contacts;
98
+ }
99
+
100
+ /**
101
+ * Terminate session
102
+ *
103
+ * Terminates the current user's session,
104
+ * debugs the request and reset's the internal
105
+ * debudder.
106
+ *
107
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
108
+ */
109
+ public function logout()
110
+ {
111
+ if (!$this->checkSession()) return false;
112
+ $this->debugRequest();
113
+ $this->resetDebugger();
114
+ $this->stopPlugin();
115
+ return true;
116
+ }
117
+ }
118
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/abv.plg.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Abv',
4
+ 'version'=>'1.0.6',
5
+ 'description'=>"Get the contacts from a Abv account",
6
+ 'base_version'=>'1.8.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.abv.bg/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(abv.bg)/i','/(gyuvetch.bg)/i','/(gbg.bg)/i'),
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger')
12
+ );
13
+ /**
14
+ * Abv Plugin
15
+ *
16
+ * Imports user's contacts from Abv AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class abv extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'host',
30
+ 'login_post'=>'plogin',
31
+ 'url_redirect'=>'Location',
32
+ 'url_inbox'=>'addrexport',
33
+ 'url_export'=>'EXPORT',
34
+ 'contacts_file'=>'Name'
35
+
36
+ );
37
+
38
+ /**
39
+ * Login function
40
+ *
41
+ * Makes all the necessary requests to authenticate
42
+ * the current user to the server.
43
+ *
44
+ * @param string $user The current user.
45
+ * @param string $pass The password for the current user.
46
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
47
+ */
48
+ public function login($user,$pass)
49
+ {
50
+ $this->resetDebugger();
51
+ $this->service='abv';
52
+ $this->service_user=$user;
53
+ $this->service_password=$pass;
54
+ if (!$this->init()) return false;
55
+
56
+ $res=$this->get("http://www.abv.bg/");
57
+ if ($this->checkResponse("initial_get",$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.abv.bg/",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.abv.bg/",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+
67
+ $user_array=explode('@',$user);$hostname=$user_array[1];$username=$user_array[0];$host=$this->getELementDOM($res,"//input[@name='host']",'value');
68
+ $form_action="https://passport.abv.bg/servlet/passportlogin";
69
+ $post_elements=array('host'=>$host[0],'username'=>$username,'hostname'=>$hostname,'password'=>$pass);
70
+ $res=$this->post($form_action,$post_elements,false,true,false,array(),false,false);
71
+ if ($this->checkResponse('login_post',$res))
72
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
73
+ else
74
+ {
75
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
76
+ $this->debugRequest();
77
+ $this->stopPlugin();
78
+ return false;
79
+ }
80
+
81
+ $url_redirect=$this->getElementString($res,'url=','"');
82
+ $res=$this->get($url_redirect,false,true,false,array(),false,false);
83
+ if ($this->checkResponse("url_redirect",$res))
84
+ $this->updateDebugBuffer('url_redirect',$url_redirect,'GET');
85
+ else
86
+ {
87
+ $this->updateDebugBuffer('url_redirect',$url_redirect,'GET',false);
88
+ $this->debugRequest();
89
+ $this->stopPlugin();
90
+ return false;
91
+ }
92
+
93
+ $url_redirect=str_replace(' [following]','',$this->getElementString($res,'Location: ',PHP_EOL));
94
+ $url_base='http://'.$this->getElementString($url_redirect,'http://','.bg').'.bg';
95
+ $res=$this->get($url_redirect,true);
96
+ if ($this->checkResponse("url_inbox",$res))
97
+ $this->updateDebugBuffer('url_inbox',$url_redirect,'GET');
98
+ else
99
+ {
100
+ $this->updateDebugBuffer('url_inbox',$url_redirect,'GET',false);
101
+ $this->debugRequest();
102
+ $this->stopPlugin();
103
+ return false;
104
+ }
105
+ $this->login_ok=$url_base;
106
+ file_put_contents($this->getLogoutPath(),$url_base);
107
+ return true;
108
+ }
109
+
110
+ /**
111
+ * Get the current user's contacts
112
+ *
113
+ * Makes all the necesarry requests to import
114
+ * the current user's contacts
115
+ *
116
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
117
+ */
118
+ public function getMyContacts()
119
+ {
120
+ if (!$this->login_ok)
121
+ {
122
+ $this->debugRequest();
123
+ $this->stopPlugin();
124
+ return false;
125
+ }
126
+ else $url=$this->login_ok;
127
+ $url_adress=$url.'/app/j/addrexport.jsp';
128
+ $res=$this->get($url_adress);
129
+ if ($this->checkResponse("url_export",$res))
130
+ $this->updateDebugBuffer('url_export',$url_adress,'GET');
131
+ else
132
+ {
133
+ $this->updateDebugBuffer('url_export',$url_adress,'GET',false);
134
+ $this->debugRequest();
135
+ $this->stopPlugin();
136
+ return false;
137
+ }
138
+
139
+ $form_action=$url.'/app/servlet/addrimpex';$post_elements=array('action'=>'EXPORT','group_id'=>0,'program'=>10);
140
+ $res=$this->post($form_action,$post_elements);
141
+ if ($this->checkResponse("contacts_file",$res))
142
+ $this->updateDebugBuffer('contacts_file',$form_action,'POST',true,$post_elements);
143
+ else
144
+ {
145
+ $this->updateDebugBuffer('contacts_file',$form_action,'POST',false,$post_elements);
146
+ $this->debugRequest();
147
+ $this->stopPlugin();
148
+ return false;
149
+ }
150
+ $temp=$this->parseCSV($res);
151
+ $contacts=array();$descriptionArray=array();
152
+ foreach ($temp as $values)
153
+ {
154
+ $contacts[$values[4]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
155
+ 'middle_name'=>(!empty($values[1])?$values[1]:false),
156
+ 'last_name'=>(!empty($values[2])?$values[2]:false),
157
+ 'nickname'=>(!empty($values[3])?$values[3]:false),
158
+ 'email_1'=>(!empty($values[4])?$values[4]:false),
159
+ 'email_2'=>(!empty($values[5])?$values[5]:false),
160
+ 'email_3'=>false,
161
+ 'organization'=>(!empty($values[8])?$values[8]:false),
162
+ 'phone_mobile'=>(!empty($values[12])?$values[12]:false),
163
+ 'phone_home'=>(!empty($values[10])?$values[10]:false),
164
+ 'phone_work'=>(!empty($values[11])?$values[11]:false),
165
+ 'fax'=>(!empty($values[13])?$values[13]:false),
166
+ 'pager'=>false,
167
+ 'address_home'=>(!empty($values[15])?$values[15]:false),
168
+ 'address_work'=>(!empty($values[20])?$values[20]:false),
169
+ 'website'=>false,
170
+ 'address_city'=>(!empty($values[16])?$values[16]:false),
171
+ 'address_state'=>false,
172
+ 'address_country'=>(!empty($values[17])?$values[17]:false),
173
+ 'postcode_home'=>(!empty($values[18])?$values[18]:false),
174
+ 'isq_messenger'=>(!empty($values[25])?$values[25]:false),
175
+ 'skype_messenger'=>(!empty($values[26])?$values[26]:false),
176
+ 'yahoo_messenger'=>(!empty($values[27])?$values[27]:false),
177
+ 'msn_messenger'=>(!empty($values[28])?$values[28]:false),
178
+ 'aol_messenger'=>(!empty($values[29])?$values[29]:false),
179
+ 'other_messenger'=>(!empty($values[30])?$values[30]:false),
180
+ );
181
+ }
182
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
183
+ return $this->returnContacts($contacts);
184
+ }
185
+
186
+ /**
187
+ * Terminate session
188
+ *
189
+ * Terminates the current user's session,
190
+ * debugs the request and reset's the internal
191
+ * debudder.
192
+ *
193
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
194
+ */
195
+ public function logout()
196
+ {
197
+ if (!$this->checkSession()) return false;
198
+ if (file_exists($this->getLogoutPath()))
199
+ {
200
+ $url_base=file_get_contents($this->getLogoutPath());
201
+ $res=$this->get($url_base.'/app/j/logout.jsp',true);
202
+ }
203
+ $this->debugRequest();
204
+ $this->resetDebugger();
205
+ $this->stopPlugin();
206
+ return true;
207
+ }
208
+
209
+ }
210
+
211
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/aol.plg.php ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'AOL',
4
+ 'version'=>'1.5.3',
5
+ 'description'=>"Get the contacts from an AOL account",
6
+ 'base_version'=>'1.9.0',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://webmail.aol.com',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(aol.com)/i'),
11
+ 'imported_details'=>array('nickname','email_1','email_2','phone_mobile','phone_home','phone_work','pager','fax_work','last_name'),
12
+ );
13
+ /**
14
+ * AOL Plugin
15
+ *
16
+ * Imports user's contacts from AOL's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.4.7
20
+ */
21
+ class aol extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'pwderr',
30
+ 'login_post'=>'loginForm',
31
+ 'url_redirect'=>'var gSuccessPath',
32
+ 'inbox'=>'aol.wsl.afExternalRunAtLoad = []',
33
+ 'print_contacts'=>'window\x27s'
34
+ );
35
+
36
+ /**
37
+ * Login function
38
+ *
39
+ * Makes all the necessary requests to authenticate
40
+ * the current user to the server.
41
+ *
42
+ * @param string $user The current user.
43
+ * @param string $pass The password for the current user.
44
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
45
+ */
46
+ public function login($user,$pass)
47
+ {
48
+ $this->resetDebugger();
49
+ $this->service='aol';
50
+ $this->service_user=$user;
51
+ $this->service_password=$pass;
52
+ if (!$this->init()) return false;
53
+
54
+ $user=(strpos($user,'@aol')!==false?str_replace('@aol.com','',$user):$user);
55
+
56
+ $res=$this->get("https://my.screenname.aol.com/_cqr/login/login.psp?sitedomain=sns.webmail.aol.com&lang=en&locale=us&authLev=0&uitype=mini&siteState=ver%3a4|rt%3aSTANDARD|at%3aSNS|ld%3awebmail.aol.com|uv%3aAOL|lc%3aen-us|mt%3aAOL|snt%3aScreenName|sid%3a22e31aa7-4747-4133-9015-842e000780b6&seamless=novl&loginId=&_sns_width_=174&_sns_height_=196&_sns_fg_color_=373737&_sns_err_color_=C81A1A&_sns_link_color_=0066CC&_sns_bg_color_=FFFFFF&redirType=js&xchk=false",true);
57
+ if ($this->checkResponse('initial_get',$res))
58
+ $this->updateDebugBuffer('initial_get',"https://my.screenname.aol.com/_cqr/login/login.psp?sitedomain=sns.webmail.aol.com&lang=en&locale=us&authLev=0&uitype=mini&siteState=ver%3a4|rt%3aSTANDARD|at%3aSNS|ld%3awebmail.aol.com|uv%3aAOL|lc%3aen-us|mt%3aAOL|snt%3aScreenName|sid%3a22e31aa7-4747-4133-9015-842e000780b6&seamless=novl&loginId=&_sns_width_=174&_sns_height_=196&_sns_fg_color_=373737&_sns_err_color_=C81A1A&_sns_link_color_=0066CC&_sns_bg_color_=FFFFFF&redirType=js&xchk=false",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"https://my.screenname.aol.com/_cqr/login/login.psp?sitedomain=sns.webmail.aol.com&lang=en&locale=us&authLev=0&uitype=mini&siteState=ver%3a4|rt%3aSTANDARD|at%3aSNS|ld%3awebmail.aol.com|uv%3aAOL|lc%3aen-us|mt%3aAOL|snt%3aScreenName|sid%3a22e31aa7-4747-4133-9015-842e000780b6&seamless=novl&loginId=&_sns_width_=174&_sns_height_=196&_sns_fg_color_=373737&_sns_err_color_=C81A1A&_sns_link_color_=0066CC&_sns_bg_color_=FFFFFF&redirType=js&xchk=false",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+
67
+ $post_elements=$this->getHiddenElements($res);$post_elements['loginId']=$user;$post_elements['password']=$pass;
68
+ $res=$this->post("https://my.screenname.aol.com/_cqr/login/login.psp",$post_elements,true);
69
+ if ($this->checkResponse('login_post',$res))
70
+ $this->updateDebugBuffer('login_post',"https://my.screenname.aol.com/_cqr/login/login.psp",'POST',true,$post_elements);
71
+ else
72
+ {
73
+ $this->updateDebugBuffer('login_post',"https://my.screenname.aol.com/_cqr/login/login.psp",'POST',false,$post_elements);
74
+ $this->debugRequest();
75
+ $this->stopPlugin();
76
+ return false;
77
+ }
78
+
79
+
80
+ $url_redirect=$this->getElementString($res,"'loginForm', 'false', '","')");
81
+ $res=$this->get($url_redirect,true);
82
+ if ($this->checkResponse('url_redirect',$res))
83
+ $this->updateDebugBuffer('url_redirect',"{$url_redirect}",'GET');
84
+ else
85
+ {
86
+ $this->updateDebugBuffer('url_redirect',"{$url_redirect}",'GET',false);
87
+ $this->debugRequest();
88
+ $this->stopPlugin();
89
+ return false;
90
+ }
91
+
92
+
93
+ $url_redirect="http://webmail.aol.com".htmlspecialchars_decode($this->getElementString($res,'var gSuccessPath = "','"',$res));
94
+ $url_redirect=str_replace("Suite.aspx","Lite/Today.aspx",$url_redirect);
95
+ $res=$this->get($url_redirect,true);
96
+ if ($this->checkResponse('inbox',$res))
97
+ $this->updateDebugBuffer('inbox',"{$url_redirect}",'GET');
98
+ else
99
+ {
100
+ $this->updateDebugBuffer('inbox',"{$url_redirect}",'GET',false);
101
+ $this->debugRequest();
102
+ $this->stopPlugin();
103
+ return false;
104
+ }
105
+
106
+ $url_contact=$this->getElementDOM($res,"//a[@id='contactsLnk']",'href');
107
+ $this->login_ok=$this->login_ok=$url_contact[0];
108
+ file_put_contents($this->getLogoutPath(),$url_contact[0]);
109
+ return true;
110
+ }
111
+
112
+ /**
113
+ * Get the current user's contacts
114
+ *
115
+ * Makes all the necesarry requests to import
116
+ * the current user's contacts
117
+ *
118
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
119
+ */
120
+ public function getMyContacts()
121
+ {
122
+ if (!$this->login_ok)
123
+ {
124
+ $this->debugRequest();
125
+ $this->stopPlugin();
126
+ return false;
127
+ }
128
+ else
129
+ $url=$this->login_ok;
130
+ //go to url inbox
131
+ $res=$this->get($url,true);
132
+
133
+
134
+ $url_temp=$this->getElementString($res,"command.','','","'");
135
+ $version=$this->getElementString($url_temp,'http://webmail.aol.com/','/');
136
+ $url_print=str_replace("');","",str_replace("PrintContacts.aspx","addresslist-print.aspx?command=all&sort=FirstLastNick&sortDir=Ascending&nameFormat=FirstLastNick&version={$version}:webmail.aol.com&user=",$url_temp));
137
+ $url_print.=$this->getElementString($res,"addresslist-print.aspx','","'");
138
+
139
+
140
+ $res=$this->get($url_print,true);
141
+
142
+ $contacts=array();
143
+ if ($this->checkResponse("print_contacts",$res))
144
+ {
145
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
146
+ $nodes=$doc->getElementsByTagName("span");$name=false;$flag_name=false;$flag_email=false;
147
+ $temp=array();
148
+ $descriptionArrayFlag=array('Screen Name:'=>'nickname','Email 1:'=>'email_1','Email 2:'=>'email_2','Mobile: '=>'phone_mobile','Home: '=>'phone_home','Work: '=>'phone_work','Pager: '=>'pager','Fax: '=>'fax_work','Family Names:'=>'last_name');
149
+ $xpath=new DOMXPath($doc);$query="//span";$data=$xpath->query($query);
150
+ foreach($data as $node)
151
+ {
152
+ if ($node->getAttribute("class")=="fullName") { $nameD=$node->nodeValue;$temp=array(); }
153
+ if (end($temp)!==false)
154
+ {
155
+ $key=key($temp);
156
+ if ($key=='Email 1:') $keyDescription=$node->nodeValue;
157
+ if (!empty($keyDescription))
158
+ {
159
+ if (empty($contacts[$keyDescription]['first_name'])) $contacts[$keyDescription]['full_name']=!empty($nameD)?$nameD:false;
160
+ $contacts[$keyDescription][$descriptionArrayFlag[$key]]=!empty($node->nodeValue)?$node->nodeValue:false; $temp[$key]=false;
161
+ }
162
+ }
163
+ if (isset($descriptionArrayFlag[$node->nodeValue])) $temp[$node->nodeValue]=true;
164
+ }
165
+ $this->updateDebugBuffer('print_contacts',"{$url_print}",'GET');
166
+ }
167
+ else
168
+ {
169
+ $this->updateDebugBuffer('print_contacts',"{$url_print}",'GET',false);
170
+ $this->debugRequest();
171
+ $this->stopPlugin();
172
+ return false;
173
+ }
174
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
175
+ return $this->returnContacts($contacts);
176
+ }
177
+
178
+ /**
179
+ * Terminate session
180
+ *
181
+ * Terminates the current user's session,
182
+ * debugs the request and reset's the internal
183
+ * debudder.
184
+ *
185
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
186
+ */
187
+ public function logout()
188
+ {
189
+ if (!$this->checkSession()) return false;
190
+ if (file_exists($this->getLogoutPath()))
191
+ {
192
+ $url=file_get_contents($this->getLogoutPath());
193
+ $res=$this->get($url,true);
194
+ $url_logout=$this->getElementDOM($res,"//a[@class='signOutLink']",'href');
195
+ if (!empty($url_logout)) $res=$this->get($url_logout[0]);
196
+ }
197
+ $this->debugRequest();
198
+ $this->resetDebugger();
199
+ $this->stopPlugin();
200
+ return true;
201
+ }
202
+
203
+ }
204
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/apropo.plg.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Apropo',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Apropo account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://amail.apropo.ro/index.php',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * Apropo.com Plugin
15
+ *
16
+ * Imports user's contacts from Apropo.ro AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class apropo extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'pop3host',
30
+ 'login_post'=>'Location',
31
+ 'url_inbox'=>'parse',
32
+ 'contacts_file'=>'Email'
33
+
34
+ );
35
+
36
+ /**
37
+ * Login function
38
+ *
39
+ * Makes all the necessary requests to authenticate
40
+ * the current user to the server.
41
+ *
42
+ * @param string $user The current user.
43
+ * @param string $pass The password for the current user.
44
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
45
+ */
46
+ public function login($user,$pass)
47
+ {
48
+ $this->resetDebugger();
49
+ $this->service='apropo';
50
+ $this->service_user=$user;
51
+ $this->service_password=$pass;
52
+ if (!$this->init()) return false;
53
+
54
+ $res=$this->get("http://amail.apropo.ro/index.php");
55
+ if ($this->checkResponse("initial_get",$res))
56
+ $this->updateDebugBuffer('initial_get',"http://amail.apropo.ro/index.php",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get','http://amail.apropo.ro/index.php','GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+
65
+ $form_action='http://login.apropo.ro/index/8';
66
+ $post_elements=array('username'=>$user,'password'=>$pass,'pop3host'=>'apropo.ro','Language'=>'romanian','LoginType'=>'simple','btnContinue'=>' ');
67
+ $res=$this->post($form_action,$post_elements,false,true,false,array(),false,false);
68
+ if ($this->checkResponse('login_post',$res))
69
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
70
+ else
71
+ {
72
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
73
+ $this->debugRequest();
74
+ $this->stopPlugin();
75
+ return false;
76
+ }
77
+
78
+ $url_redirect=str_replace(' [following]','',$this->getElementString($res,'Location: ',PHP_EOL));
79
+ $res=$this->get($url_redirect,false,true);
80
+ if ($this->checkResponse("url_inbox",$res))
81
+ $this->updateDebugBuffer('url_inbox',$url_redirect,'GET');
82
+ else
83
+ {
84
+ $this->updateDebugBuffer('url_inbox',$url_redirect,'GET',false);
85
+ $this->debugRequest();
86
+ $this->stopPlugin();
87
+ return false;
88
+ }
89
+
90
+ $url_export='http://amail.apropo.ro/abook.php?func=export&abookview=personal';
91
+ $this->login_ok=$url_export;
92
+ return true;
93
+ }
94
+
95
+ /**
96
+ * Get the current user's contacts
97
+ *
98
+ * Makes all the necesarry requests to import
99
+ * the current user's contacts
100
+ *
101
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
102
+ */
103
+ public function getMyContacts()
104
+ {
105
+ if (!$this->login_ok)
106
+ {
107
+ $this->debugRequest();
108
+ $this->stopPlugin();
109
+ return false;
110
+ }
111
+ else $url=$this->login_ok;
112
+ $res=$this->get($url);
113
+ if ($this->checkResponse("contacts_file",$res))
114
+ $this->updateDebugBuffer('contacts_file',$url,'GET');
115
+ else
116
+ {
117
+ $this->updateDebugBuffer('contacts_file',$url,'GET',false);
118
+ $this->debugRequest();
119
+ $this->stopPlugin();
120
+ return false;
121
+ }
122
+
123
+ $temp=$this->parseCSV($res);
124
+ $contacts=array();$descriptionArray=array();
125
+ foreach ($temp as $values)
126
+ {
127
+ if (!empty($values[1]))
128
+ $contacts[$values[1]]=array('first_name'=>(!empty($values[6])?$values[6]:false),
129
+ 'middle_name'=>(!empty($values[18])?$values[18]:false),
130
+ 'last_name'=>(!empty($values[17])?$values[17]:false),
131
+ 'nickname'=>(!empty($values[3])?$values[3]:false),
132
+ 'email_1'=>(!empty($values[1])?$values[1]:false),
133
+ 'email_2'=>(!empty($values[2])?$values[2]:false),
134
+ 'email_3'=>(!empty($values[3])?$values[3]:false),
135
+ 'organization'=>false,
136
+ 'phone_mobile'=>(!empty($values[12])?$values[12]:false),
137
+ 'phone_home'=>(!empty($values[10])?$values[10]:false),
138
+ 'pager'=>false,
139
+ 'address_home'=>(!empty($values[8])?$values[8]:false),
140
+ 'address_city'=>(!empty($values[9])?$values[9]:false),
141
+ 'address_state'=>false,
142
+ 'address_country'=>(!empty($values[10])?$values[10]:false),
143
+ 'postcode_home'=>(!empty($values[15])?$values[15]:false),
144
+ 'company_work'=>(!empty($values[24])?$values[24]:false),
145
+ 'address_work'=>(!empty($values[22])?$values[22]:false),
146
+ 'address_work_city'=>(!empty($values[23])?$values[23]:false),
147
+ 'address_work_country'=>(!empty($values[25])?$values[25]:false),
148
+ 'address_work_state'=>(!empty($values[25])?$values[25]:false),
149
+ 'address_work_postcode'=>(!empty($values[33])?$values[33]:false),
150
+ 'fax_work'=>(!empty($values[27])?$values[27]:false),
151
+ 'phone_work'=>(!empty($values[30])?$values[30]:false),
152
+ 'website'=>(!empty($values[21])?$values[21]:false),
153
+ 'isq_messenger'=>false,
154
+ 'skype_essenger'=>false,
155
+ 'yahoo_essenger'=>false,
156
+ 'msn_messenger'=>false,
157
+ 'aol_messenger'=>false,
158
+ 'other_messenger'=>false,
159
+ );
160
+ }
161
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
162
+ return $this->returnContacts($contacts);
163
+ }
164
+
165
+ /**
166
+ * Terminate session
167
+ *
168
+ * Terminates the current user's session,
169
+ * debugs the request and reset's the internal
170
+ * debudder.
171
+ *
172
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
173
+ */
174
+ public function logout()
175
+ {
176
+ if (!$this->checkSession()) return false;
177
+ $res=$this->get('http://login.apropo.ro/logout/8/?TB_iframe=true&width=400&height=400',true);
178
+ $this->debugRequest();
179
+ $this->resetDebugger();
180
+ $this->stopPlugin();
181
+ return true;
182
+ }
183
+
184
+ }
185
+
186
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/atlas.plg.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Atlas',
4
+ 'version'=>'1.0.4 ',
5
+ 'description'=>"Get the contacts from a Atlas account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.atlas.cz/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','last_name','email_1'),
12
+ );
13
+ /**
14
+ * Atlas.cz Plugin
15
+ *
16
+ * Imports user's contacts from Atlas.cz AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class atlas extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'name',
30
+ 'login_post'=>'password',
31
+ 'redirect_post'=>'href="',
32
+ 'logged'=>'addressbook',
33
+ 'url_contacts'=>'rm',
34
+ );
35
+
36
+ /**
37
+ * Login function
38
+ *
39
+ * Makes all the necessary requests to authenticate
40
+ * the current user to the server.
41
+ *
42
+ * @param string $user The current user.
43
+ * @param string $pass The password for the current user.
44
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
45
+ */
46
+ public function login($user,$pass)
47
+ {
48
+ $this->resetDebugger();
49
+ $this->service='atlas';
50
+ $this->service_user=$user;
51
+ $this->service_password=$pass;
52
+ if (!$this->init()) return false;
53
+
54
+ $res=$this->get("http://auser.centrum.cz/");
55
+ if ($this->checkResponse("initial_get",$res))
56
+ $this->updateDebugBuffer('initial_get',"http://auser.centrum.cz/",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get','http://auser.centrum.cz/','GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+
65
+ $form_action='https://auser.centrum.cz/';
66
+ $post_elements=array('url'=>'http://profil.centrum.cz/verify.aspx','ego_user'=>$user,'ego_domain'=>'atlas.cz','ego_secret'=>$pass);
67
+ $res=$this->post($form_action,$post_elements);
68
+ if ($this->checkResponse('login_post',$res))
69
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
70
+ else
71
+ {
72
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
73
+ $this->debugRequest();
74
+ $this->stopPlugin();
75
+ return false;
76
+ }
77
+
78
+ $form_action='https://profil.mujblog.centrum.cz/verify.aspx';
79
+ $post_elements=array('name'=>"{$user}@atlas.cz",'password'=>"{$pass}","refapp"=>"http://atlasmail.centrum.cz","emptyurl"=>"http://profil.mujblog.centrum.cz/login.aspx");
80
+ $res=$this->post($form_action,$post_elements);
81
+ if ($this->checkResponse('redirect_post',$res))
82
+ $this->updateDebugBuffer('redirect_post',$form_action,'POST',true,$post_elements);
83
+ else
84
+ {
85
+ $this->updateDebugBuffer('redirect_post',$form_action,'POST',false,$post_elements);
86
+ $this->debugRequest();
87
+ $this->stopPlugin();
88
+ return false;
89
+ }
90
+
91
+ $url_redirect=$this->getElementString($res,'href="','"');
92
+ $res=$this->get($url_redirect,true);
93
+ if ($this->checkResponse("logged",$res))
94
+ $this->updateDebugBuffer('logged',"{$url_redirect}",'GET');
95
+ else
96
+ {
97
+ $this->updateDebugBuffer('logged',"{$url_redirect}",'GET',false);
98
+ $this->debugRequest();
99
+ $this->stopPlugin();
100
+ return false;
101
+ }
102
+
103
+ $url_contacts='http://atlasmail.centrum.cz/addressbook.aspx';
104
+ $this->login_ok=$url_contacts;
105
+ return true;
106
+ }
107
+
108
+ /**
109
+ * Get the current user's contacts
110
+ *
111
+ * Makes all the necesarry requests to import
112
+ * the current user's contacts
113
+ *
114
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
115
+ */
116
+ public function getMyContacts()
117
+ {
118
+ if (!$this->login_ok)
119
+ {
120
+ $this->debugRequest();
121
+ $this->stopPlugin();
122
+ return false;
123
+ }
124
+ else $url=$this->login_ok;
125
+ $res=$this->get($url,true);
126
+ if ($this->checkResponse("url_contacts",$res))
127
+ $this->updateDebugBuffer('contacts_file',$url,'GET');
128
+ else
129
+ {
130
+ $this->updateDebugBuffer('contacts_file',$url,'GET',false);
131
+ $this->debugRequest();
132
+ $this->stopPlugin();
133
+ return false;
134
+ }
135
+
136
+ $contacts=array();
137
+ if (preg_match_all("#abeditcontact.aspx\?contactid\=(.+)\"\>#U", $res, $matches))
138
+ {
139
+ $matches=array_unique($matches[1]);
140
+ foreach($matches as $matchValue)
141
+ {
142
+ $last_name=false;$first_name=false;
143
+ preg_match_all("#{$matchValue}\"\>(.+)</a>#U", $res, $matches2);
144
+ if (!empty($matches2[1]))
145
+ {
146
+ $last_name=(!empty($matches2[1][1])?$matches2[1][1]:false);
147
+ $first_name=(!empty($matches2[1][0])?$matches2[1][0]:false);
148
+ if(!empty($matches2[1][2])) $contacts[$matches2[1][2]]=array('first_name'=>$first_name,'last_name'=>$last_name,'email_1'=>$matches2[1][2]);
149
+ }
150
+ }
151
+ }
152
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
153
+ return $this->returnContacts($contacts);
154
+ }
155
+
156
+ /**
157
+ * Terminate session
158
+ *
159
+ * Terminates the current user's session,
160
+ * debugs the request and reset's the internal
161
+ * debudder.
162
+ *
163
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
164
+ */
165
+ public function logout()
166
+ {
167
+ if (!$this->checkSession()) return false;
168
+ $res=$this->get('http://www.atlas.cz/r/?ump',true);
169
+ $this->debugRequest();
170
+ $this->resetDebugger();
171
+ $this->stopPlugin();
172
+ return true;
173
+ }
174
+
175
+ }
176
+
177
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/aussiemail.plg.php ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Aussiemail',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Aussiemail account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://freemail.aussiemail.com.au/email/scripts/loginuser.pl',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Aussiemail Plugin
15
+ *
16
+ * Imports user's contacts from Aussiemail AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class aussiemail extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'loginName',
30
+ 'login_post'=>'EV1',
31
+ 'login_post1'=>'location',
32
+ 'url_contacts'=>'addTo'
33
+ );
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user,$pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='aussiemail';
49
+ $this->service_user=$user;
50
+ $this->service_password=$pass;
51
+ if (!$this->init()) return false;
52
+
53
+ $res=$this->get("http://freemail.aussiemail.com.au/email/scripts/loginuser.pl");
54
+ if ($this->checkResponse("initial_get",$res))
55
+ $this->updateDebugBuffer('initial_get',"http://freemail.aussiemail.com.au/email/scripts/loginuser.pl",'GET');
56
+ else
57
+ {
58
+ $this->updateDebugBuffer('initial_get','http://freemail.aussiemail.com.au/email/scripts/loginuser.pl','GET',false);
59
+ $this->debugRequest();
60
+ $this->stopPlugin();
61
+ return false;
62
+ }
63
+ $form_action='http://freemail.aussiemail.com.au/email/scripts/loginuser.pl?EV1='.$this->getElementString($res,'EV1=','"');
64
+ $post_elements=array('loginName'=>$user,'user_pwd'=>$pass,'login'=>'Login');
65
+ $res=$this->post($form_action,$post_elements);
66
+
67
+ if (strpos($res,'index.pl?EV1=')!==false)
68
+ {
69
+ if ($this->checkResponse("login_post",$res))
70
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
71
+ else
72
+ {
73
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
74
+ $this->debugRequest();
75
+ $this->stopPlugin();
76
+ return false;
77
+ }
78
+ $url_redirect=$this->getElementString($res,'HREF="','"');
79
+ $res=$this->get($url_redirect,true);
80
+ }
81
+ else
82
+ if ($this->checkResponse("login_post1",$res))
83
+ $this->updateDebugBuffer('login_post1',"{$form_action}",'POST',true,$post_elements);
84
+ else
85
+ {
86
+ $this->updateDebugBuffer('login_post1',"{$form_action}",'POST',false,$post_elements);
87
+ $this->debugRequest();
88
+ $this->stopPlugin();
89
+ return false;
90
+ }
91
+
92
+
93
+ $url_contacts='http://freemail.aussiemail.com.au/email/scripts/miniContacts.pl';
94
+ $this->login_ok=$url_contacts;
95
+ return true;
96
+ }
97
+
98
+ /**
99
+ * Get the current user's contacts
100
+ *
101
+ * Makes all the necesarry requests to import
102
+ * the current user's contacts
103
+ *
104
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
105
+ */
106
+ public function getMyContacts()
107
+ {
108
+ if (!$this->login_ok)
109
+ {
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+ else $url=$this->login_ok;
115
+ $res=$this->get($url,true);
116
+ if ($this->checkResponse("url_contacts",$res))
117
+ $this->updateDebugBuffer('contacts_file',$url,'GET');
118
+ else
119
+ {
120
+ $this->updateDebugBuffer('contacts_file',$url,'GET',false);
121
+ $this->debugRequest();
122
+ $this->stopPlugin();
123
+ return false;
124
+ }
125
+
126
+ $contacts = array();
127
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
128
+ $xpath=new DOMXPath($doc);$query="//a";$data=$xpath->query($query);$name="";
129
+ foreach($data as $node)
130
+ {
131
+ $stringBulk=$node->getAttribute('href');
132
+ if (strpos($stringBulk,'addTo(')!==false)
133
+ { $name=$this->getElementString($stringBulk,'"','"');$email=$this->getElementString($stringBulk,'" <','>'); }
134
+ if (!empty($email)) $contacts[$email]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$email);
135
+ }
136
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
137
+ return $this->returnContacts($contacts);
138
+ }
139
+
140
+ /**
141
+ * Terminate session
142
+ *
143
+ * Terminates the current user's session,
144
+ * debugs the request and reset's the internal
145
+ * debudder.
146
+ *
147
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
148
+ */
149
+ public function logout()
150
+ {
151
+ if (!$this->checkSession()) return false;
152
+ $res=$this->get('http://freemail.aussiemail.com.au/email/scripts/logout.pl',true);
153
+ $this->debugRequest();
154
+ $this->resetDebugger();
155
+ $this->stopPlugin();
156
+ return true;
157
+ }
158
+
159
+ }
160
+
161
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/azet.plg.php ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Azet',
4
+ 'version'=>'1.0.5',
5
+ 'description'=>"Get the contacts from a Azet account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://emailnew.azet.sk/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Azet Plugin
15
+ *
16
+ * Imports user's contacts from Azet AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.1
20
+ */
21
+ class azet extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'heslo',
30
+ 'login_post'=>'OtvorPomoc',
31
+ 'url_contacts'=>'adr_mail'
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user,$pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='azet';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("http://emailnew.azet.sk/");
53
+ if ($this->checkResponse("initial_get",$res))
54
+ $this->updateDebugBuffer('initial_get',"http://emailnew.azet.sk/",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"http://emailnew.azet.sk/",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+
63
+ $form_action=$this->getElementString($res,'action="','"');
64
+ $post_elements=array('form[username]'=>$user,
65
+ 'form[password]'=>$pass,
66
+ 'Posliform'=>urldecode('Prihl%C3%A1si%C5%A5')
67
+ );
68
+ $res=$this->post($form_action,$post_elements,true);
69
+ if ($this->checkResponse('login_post',$res))
70
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
71
+ else
72
+ {
73
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
74
+ $this->debugRequest();
75
+ $this->stopPlugin();
76
+ return false;
77
+ }
78
+
79
+ $sid=$this->getElementString($res,'href="Adresar.phtml?&','&');
80
+ $url_contacts="http://emailnew.azet.sk/Adresar.phtml?{$sid}&t_vypis=";
81
+ file_put_contents($this->getLogoutPath(),$sid);
82
+ $this->login_ok=$url_contacts;
83
+ return true;
84
+ }
85
+
86
+ /**
87
+ * Get the current user's contacts
88
+ *
89
+ * Makes all the necesarry requests to import
90
+ * the current user's contacts
91
+ *
92
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
93
+ */
94
+ public function getMyContacts()
95
+ {
96
+ if (!$this->login_ok)
97
+ {
98
+ $this->debugRequest();
99
+ $this->stopPlugin();
100
+ return false;
101
+ }
102
+ else $url=$this->login_ok;
103
+ $res=$this->get($url);
104
+ if ($this->checkResponse("url_contacts",$res))
105
+ $this->updateDebugBuffer('url_contacts',$url,'GET');
106
+ else
107
+ {
108
+ $this->updateDebugBuffer('url_contacts',$url,'GET',false);
109
+ $this->debugRequest();
110
+ $this->stopPlugin();
111
+ return false;
112
+ }
113
+ $contacts=array();
114
+ $contacts_name=$this->getElementDOM($res,"//td[@class='adr_meno']");
115
+ $contacts_email=$this->getElementDOM($res,"//td[@class='adr_mail']");
116
+ if (isset($contacts_email)) foreach($contacts_email as $key=>$value) if (isset($contacts_name[$key])) $contacts[trim(preg_replace('/[^(\x20-\x7F)]*/','',(string)$value))]=array('first_name'=>$contacts_name[$key],'email_1'=>trim(preg_replace('/[^(\x20-\x7F)]*/','',(string)$value)));
117
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
118
+ return $this->returnContacts($contacts);
119
+ }
120
+
121
+ /**
122
+ * Terminate session
123
+ *
124
+ * Terminates the current user's session,
125
+ * debugs the request and reset's the internal
126
+ * debudder.
127
+ *
128
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
129
+ */
130
+ public function logout()
131
+ {
132
+ if (!$this->checkSession()) return false;
133
+ if (file_exists($this->getLogoutPath()))
134
+ {
135
+ $sid=file_get_contents($this->getLogoutPath());
136
+ $url_logout="http://moje.azet.sk/odhlasenie.phtml?$sid'";
137
+ $res=$this->get($url_logout,true);
138
+ }
139
+ $this->debugRequest();
140
+ $this->resetDebugger();
141
+ $this->stopPlugin();
142
+ return true;
143
+ }
144
+
145
+ }
146
+
147
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/badoo.plg.php ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Created on Feb 10, 2009 by Vlad
4
+ */
5
+
6
+ $_pluginInfo=array(
7
+ 'name'=>'Badoo',
8
+ 'version'=>'1.0.5',
9
+ 'description'=>"Get the contacts from a badoo.com account",
10
+ 'base_version'=>'1.6.7',
11
+ 'type'=>'social',
12
+ 'check_url'=>'http://www.badoo.com/',
13
+ 'requirement'=>'email',
14
+ 'allowed_domains'=>false,
15
+ );
16
+ class badoo extends openinviter_base
17
+ {
18
+ private $login_ok=false;
19
+ public $showContacts=true;
20
+ public $internalError=false;
21
+ protected $timeout=30;
22
+
23
+ public $debug_array=array(
24
+ 'login_post'=>'location',
25
+ 'get_friends'=>'name',
26
+ );
27
+
28
+ /**
29
+ * Login function
30
+ *
31
+ * Makes all the necessary requests to authenticate
32
+ * the current user to the server.
33
+ *
34
+ * @param string $user The current user.
35
+ * @param string $pass The password for the current user.
36
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
37
+ */
38
+ public function login($user,$pass)
39
+ {
40
+ $this->resetDebugger();
41
+ $this->service='badoo';
42
+ $this->service_user=$user;
43
+ $this->service_password=$pass;
44
+
45
+ if (!$this->init()) return false;
46
+
47
+ $res = $this->get('http://badoo.com/?lang_id=3',true);
48
+ $url = $this->getElementString($res,'<a href="http://badoo.com/signin/','" class="sign_in">');
49
+ $res = $this->get("http://badoo.com/signin/".$url,true);
50
+ $post_elements=array();
51
+ $post_elements['email']=$user;
52
+ $post_elements['password']=$pass;
53
+ $post_elements['post']='';
54
+ $res = $this->post("http://badoo.com/signin/",$post_elements,true);
55
+ if ($this->checkResponse("login_post",$res))
56
+ $this->updateDebugBuffer('login_post',"http://badoo.com/signin/",'POST');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('login_post',"http://badoo.com/signin/",'POST',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+ $id=$this->getElementString($res,"user_id=","&");
65
+ if (!is_numeric($id)) return false;
66
+ $this->login_ok=$id;
67
+ return true;
68
+ }
69
+
70
+ /**
71
+ * Get the current user's contacts
72
+ *
73
+ * Makes all the necesarry requests to import
74
+ * the current user's contacts
75
+ *
76
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
77
+ */
78
+ public function getMyContacts()
79
+ {
80
+ if (!$this->login_ok)
81
+ {
82
+ $this->debugRequest();
83
+ $this->stopPlugin();
84
+ return false;
85
+ }
86
+ else $id=$this->login_ok;
87
+ $res=$this->get("http://badoo.com/{$id}/contacts/subscriptions.phtml",true);
88
+ if ($this->checkResponse("get_friends",$res))
89
+ $this->updateDebugBuffer('get_friends',"http://badoo.com/{$id}/contacts/subscriptions.phtml",'GET');
90
+ else
91
+ {
92
+ $this->updateDebugBuffer('get_friends',"http://badoo.com/{$id}/contacts/subscriptions.phtml",'GET',false);
93
+ $this->debugRequest();
94
+ $this->stopPlugin();
95
+ return false;
96
+ }
97
+ $contacts=array();
98
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
99
+ $xpath=new DOMXPath($doc);$query="//a[@class='name']";$data=$xpath->query($query);
100
+ foreach($data as $node)
101
+ {
102
+ $name=$node->nodeValue;
103
+ $cId=str_replace('uid1','01',$node->getAttribute('id'));
104
+ $href="http://badoo.com/{$id}/contacts/message/{$cId}";
105
+ if (!empty($href)) $contacts[$href]=$name;
106
+ }
107
+ return $contacts;
108
+ }
109
+ /**
110
+ * Send message to contacts
111
+ *
112
+ * Sends a message to the contacts using
113
+ * the service's inernal messaging system
114
+ *
115
+ * @param string $cookie_file The location of the cookies file for the current session
116
+ * @param string $message The message being sent to your contacts
117
+ * @param array $contacts An array of the contacts that will receive the message
118
+ * @return mixed FALSE on failure.
119
+ */
120
+ public function sendMessage($session_id,$message,$contacts)
121
+ {
122
+ $countMessages=0;
123
+ foreach($contacts as $url=>$name)
124
+ {
125
+ $countMessages++;
126
+ $res = $this->get($url."?swf=1");
127
+ $master_id = $this->getElementString($url,'http://badoo.com/','/');
128
+ $post_url = "http://badoo.com/{$master_id}/contacts/ws-post.phtml";
129
+ $post_elements = array('s1'=>$this->getElementString($res,'name="s1" value="','"'),'contact_user_id'=>$this->getElementString($res,'name="contact_user_id" value="','"'),'action'=>'add');
130
+ $post_elements['flash'] = '1';
131
+ $post_elements['message'] = $message['subject']."<br>".$message['body'];
132
+ $res = $this->post($post_url,$post_elements,true);
133
+ sleep($this->messageDelay);
134
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
135
+ }
136
+ return true;
137
+ }
138
+ /**
139
+ * Terminate session
140
+ *
141
+ * Terminates the current user's session,
142
+ * debugs the request and reset's the internal
143
+ * debudder.
144
+ *
145
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
146
+ */
147
+ public function logout()
148
+ {
149
+ if (!$this->checkSession()) return false;
150
+ $res=$this->get("http://badoo.com/signout/");
151
+ $this->debugRequest();
152
+ $this->resetDebugger();
153
+ $this->stopPlugin();
154
+ return true;
155
+ }
156
+ }
157
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/bebo.plg.php ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Bebo
3
+ * You can send message to your Bebo Inbox
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Bebo',
7
+ 'version'=>'1.0.4',
8
+ 'description'=>"Get the contacts from a Bebo account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.bebo.com/',
12
+ 'requirement'=>'user',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Bebo Plugin
17
+ *
18
+ * Import user's contacts from Bebo and send
19
+ * messages using the internal messaging system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class bebo extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'EmailUsername',
33
+ 'login_post'=>'top.location.replace',
34
+ 'url_friends'=>'height=90',
35
+ 'url_send_message'=>'SendTo',
36
+ 'send_message'=>'message has been sent'
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='bebo';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+ $res=$this->get("http://www.bebo.com/");
57
+ if ($this->checkResponse("initial_get",$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.bebo.com/",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.bebo.com/",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+
67
+ $form_action="https://secure.bebo.com/SignIn.jsp";
68
+ $post_elements=array('EmailUsername'=>$user,
69
+ 'Password'=>$pass,
70
+ 'SignIn'=>'Sign In >'
71
+ );
72
+ $res=$this->post($form_action,$post_elements,true);
73
+ if ($this->checkResponse("login_post",$res))
74
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
75
+ else
76
+ {
77
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
78
+ $this->debugRequest();
79
+ $this->stopPlugin();
80
+ return false;
81
+ }
82
+ $url_friends='http://www.bebo.com/MyFriends.jsp';
83
+
84
+ $this->login_ok=$url_friends;
85
+ return true;
86
+ }
87
+
88
+ /**
89
+ * Get the current user's contacts
90
+ *
91
+ * Makes all the necesarry requests to import
92
+ * the current user's contacts
93
+ *
94
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
95
+ */
96
+ public function getMyContacts()
97
+ {
98
+ if (!$this->login_ok)
99
+ {
100
+ $this->debugRequest();
101
+ $this->stopPlugin();
102
+ return false;
103
+ }
104
+ else $url=$this->login_ok;
105
+ $res=$this->get($url,true);
106
+ if ($this->checkResponse("url_friends",$res))
107
+ $this->updateDebugBuffer('url_friends',$url,'GET');
108
+ else
109
+ {
110
+ $this->updateDebugBuffer('url_friends',$url,'GET',false);
111
+ $this->debugRequest();
112
+ $this->stopPlugin();
113
+ return false;
114
+ }
115
+
116
+ $contacts=array();
117
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
118
+ $xpath=new DOMXPath($doc);$query="//img[@height='90']";$data=$xpath->query($query);
119
+ foreach ($data as $node) $contacts[$node->parentNode->getAttribute('href')]=$node->parentNode->nodeValue;
120
+ return $contacts;
121
+ }
122
+
123
+ /**
124
+ * Send message to contacts
125
+ *
126
+ * Sends a message to the contacts using
127
+ * the service's inernal messaging system
128
+ *
129
+ * @param string $cookie_file The location of the cookies file for the current session
130
+ * @param string $message The message being sent to your contacts
131
+ * @param array $contacts An array of the contacts that will receive the message
132
+ * @return mixed FALSE on failure.
133
+ */
134
+ public function sendMessage($session_id,$message,$contacts)
135
+ {
136
+ $countMessages=0;
137
+ foreach($contacts as $href=>$name)
138
+ {
139
+ $countMessages++;
140
+ $url_send_message='http://www.bebo.com/mail/MailCompose.jsp?ToMemberId='.str_replace("Profile.jsp?MemberId=",'',$href);
141
+ $res=$this->get($url_send_message,true);
142
+ if ($this->checkResponse("url_send_message",$res))
143
+ $this->updateDebugBuffer('url_send_message',"shttp://www.bebo.com/",'GET');
144
+ else
145
+ {
146
+ $this->updateDebugBuffer('url_send_message',"http://www.bebo.com/",'GET',false);
147
+ $this->debugRequest();
148
+ $this->stopPlugin();
149
+ return false;
150
+ }
151
+ $form_action=$url_send_message;
152
+ $post_elements=array('SendTo'=>'M'.str_replace("Profile.jsp?MemberId=",'',$href),
153
+ 'Subject'=>$message['subject'],
154
+ 'Message'=>$message['body'],
155
+ 'Send'=>' Send ',
156
+ 'MailSkinId'=>$this->getElementString($res,"MailSkinId value=",' '),
157
+ );
158
+ $res=$this->post($form_action,$post_elements,true);
159
+ if ($this->checkResponse("send_message",$res))
160
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
161
+ else
162
+ {
163
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
164
+ $this->debugRequest();
165
+ $this->stopPlugin();
166
+ return false;
167
+ }
168
+ sleep($this->messageDelay);
169
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
170
+ }
171
+ }
172
+
173
+ /**
174
+ * Terminate session
175
+ *
176
+ * Terminates the current user's session,
177
+ * debugs the request and reset's the internal
178
+ * debudder.
179
+ *
180
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
181
+ */
182
+ public function logout()
183
+ {
184
+ if (!$this->checkSession()) return false;
185
+ $res=$this->get("http://www.bebo.com/c/account/sign_out");
186
+ $this->debugRequest();
187
+ $this->resetDebugger();
188
+ $this->stopPlugin();
189
+ return true;
190
+ }
191
+ }
192
+
193
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/bigstring.plg.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Bigstring',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from an Bigstring account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.bigstring.com/?old=1',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(bigstring.com)/i'),
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Bigstring Plugin
15
+ *
16
+ * Imports user's contacts from Bigstring AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class bigstring extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array('initial_get'=>'userpass',
29
+ 'login_post'=>'frame',
30
+ 'url_contacts'=>'E-mail:'
31
+ );
32
+
33
+ /**
34
+ * Login function
35
+ *
36
+ * Makes all the necessary requests to authenticate
37
+ * the current user to the server.
38
+ *
39
+ * @param string $user The current user.
40
+ * @param string $pass The password for the current user.
41
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
42
+ */
43
+ public function login($user, $pass)
44
+ {
45
+ $this->resetDebugger();
46
+ $this->service='bigstring';
47
+ $this->service_user=$user;
48
+ $this->service_password=$pass;
49
+ if (!$this->init()) return false;
50
+
51
+ $res = $this->get("http://www.bigstring.com/?old=1");
52
+ if ($this->checkResponse("initial_get",$res))
53
+ $this->updateDebugBuffer('initial_get',"http://www.bigstring.com/?old=1",'GET');
54
+ else
55
+ {
56
+ $this->updateDebugBuffer('initial_get',"http://www.bigstring.com/?old=1",'GET',false);
57
+ $this->debugRequest();
58
+ $this->stopPlugin();
59
+ return false;
60
+ }
61
+
62
+ $form_action='http://www.bigstring.com/email/login.php';
63
+ $post_elements=array('username'=>$user,'userpass'=>$pass,'free'=>'Log-In');
64
+ $res=$this->post($form_action,$post_elements,true);
65
+ if ($this->checkResponse("login_post",$res))
66
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
67
+ else
68
+ {
69
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
70
+ $this->debugRequest();
71
+ $this->stopPlugin();
72
+ return false;
73
+ }
74
+
75
+
76
+
77
+ $url_contacts="http://www.bigstring.com/email/addressbook/viewallcontacts.php?view=detailed";
78
+ $this->login_ok=$url_contacts;
79
+ return true;
80
+ }
81
+
82
+ /**
83
+ * Get the current user's contacts
84
+ *
85
+ * Makes all the necesarry requests to import
86
+ * the current user's contacts
87
+ *
88
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
89
+ */
90
+ public function getMyContacts()
91
+ {
92
+ if (!$this->login_ok)
93
+ {
94
+ $this->debugRequest();
95
+ $this->stopPlugin();
96
+ return false;
97
+ }
98
+ else $url=$this->login_ok;
99
+ $res=$this->get($url);
100
+ if ($this->checkResponse("url_contacts",$res))
101
+ $this->updateDebugBuffer('url_contacts',$url,'GET');
102
+ else
103
+ {
104
+ $this->updateDebugBuffer('url_contacts',$url,'GET',false);
105
+ $this->debugRequest();
106
+ $this->stopPlugin();
107
+ return false;
108
+ }
109
+
110
+ $contacts=array();
111
+ $names_array=$this->getElementDOM($res,"//td[@colspan='3']",'title');
112
+ $emails_array=$this->getElementDOM($res,"//td[.='E-mail:']",'title');
113
+ foreach($names_array as $key=>$values) $contacts[$emails_array[$key]]=array('first_name'=>$values,'email_1'=>$emails_array[$key]);
114
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
115
+ return $this->returnContacts($contacts);
116
+ }
117
+
118
+ /**
119
+ * Terminate session
120
+ *
121
+ * Terminates the current user's session,
122
+ * debugs the request and reset's the internal
123
+ * debudder.
124
+ *
125
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
126
+ */
127
+ public function logout()
128
+ {
129
+ if (!$this->checkSession()) return false;
130
+ $res=$this->get("http://www.bigstring.com/email/logout.php",true);
131
+ $this->debugRequest();
132
+ $this->resetDebugger();
133
+ $this->stopPlugin();
134
+ }
135
+ }
136
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/bookcrossing.plg.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Bookcrossing',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get your frineds from a bookcrossing.com account and sends private messages",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'social',
8
+ 'check_url'=>'http://www.bookcrossing.com/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * bookcrossing.com Plugin
14
+ *
15
+ * Imports user's friends from bookcrossing.com's
16
+ *
17
+ * @author OpenInviter
18
+ * @version 1.0.3
19
+ */
20
+ class bookcrossing extends openinviter_base
21
+ {
22
+ private $login_ok=false;
23
+ public $showContacts=true;
24
+ public $internalError=false;
25
+ protected $timeout=30;
26
+
27
+ public $debug_array=array(
28
+ 'initial_get'=>'submitLoginForm',
29
+ 'login_post'=>'Welcome',
30
+ 'get_friends'=>'tiny',
31
+ 'send_message'=>'Sent'
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user,$pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='bookcrossing';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+
51
+ if (!$this->init()) return false;
52
+ $res=$this->get('http://bookcrossing.com/login',true);
53
+ if ($this->checkResponse("initial_get",$res))
54
+ $this->updateDebugBuffer('initial_get',"http://bookcrossing.com/login",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"http://bookcrossing.com/login",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+
63
+ $form_action='http://bookcrossing.com/login';
64
+ $post_elements=array('action'=>'submitLoginForm','currentaction'=>'login','email'=>$user,'password'=>$pass);
65
+ $res=$this->post("http://bookcrossing.com/action.htm",$post_elements,true,true);
66
+ if ($this->checkResponse("login_post",$res))
67
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
68
+ else
69
+ {
70
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
71
+ $this->debugRequest();
72
+ $this->stopPlugin();
73
+ return false;
74
+ }
75
+
76
+ $this->login_ok="http://bookcrossing.com/friends";
77
+ return true;
78
+ }
79
+
80
+ /**
81
+ * Get the current user's contacts
82
+ *
83
+ * Makes all the necesarry requests to import
84
+ * the current user's contacts
85
+ *
86
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
87
+ */
88
+ public function getMyContacts()
89
+ {
90
+ if (!$this->login_ok)
91
+ {
92
+ $this->debugRequest();
93
+ $this->stopPlugin();
94
+ return false;
95
+ }
96
+ else $url=$this->login_ok;
97
+ $res=$this->get($url);
98
+ if ($this->checkResponse("get_friends",$res))
99
+ $this->updateDebugBuffer('get_friends',$url,'GET');
100
+ else
101
+ {
102
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
103
+ $this->debugRequest();
104
+ $this->stopPlugin();
105
+ return false;
106
+ }
107
+
108
+ $contacts=array();
109
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
110
+ $xpath=new DOMXPath($doc);$query="//td[@class='tiny'][@align='left']";$data=$xpath->query($query);
111
+ foreach($data as $node)
112
+ {
113
+ $name=$node->childNodes->item(1)->nodeValue;
114
+ if (!empty($name)) $contacts[$name]=$name;
115
+ }
116
+ return $contacts;
117
+ }
118
+
119
+ /**
120
+ * Send message to contacts
121
+ *
122
+ * Sends a message to the contacts using
123
+ * the service's inernal messaging system
124
+ *
125
+ * @param string $cookie_file The location of the cookies file for the current session
126
+ * @param string $message The message being sent to your contacts
127
+ * @param array $contacts An array of the contacts that will receive the message
128
+ * @return mixed FALSE on failure.
129
+ */
130
+ public function sendMessage($session_id,$message,$contacts)
131
+ {
132
+ $countMessages=0;
133
+ foreach($contacts as $name)
134
+ {
135
+ $countMessages++;
136
+ $form_action="http://bookcrossing.com/sendmessage/{$name}";
137
+ $post_elements=array('sysSubmitButton'=>'Send Now','action'=>'submitSendMessage','messageto'=>$name,'subject'=>$message['subject'],'message'=>$message['body']);
138
+ $res=$this->post($form_action,$post_elements,true,true);
139
+ if ($this->checkResponse("send_message",$res))
140
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
141
+ else
142
+ {
143
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
144
+ $this->debugRequest();
145
+ $this->stopPlugin();
146
+ return false;
147
+ }
148
+ sleep($this->messageDelay);
149
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
150
+ }
151
+ }
152
+
153
+ /**
154
+ * Terminate session
155
+ *
156
+ * Terminates the current user's session,
157
+ * debugs the request and reset's the internal
158
+ * debudder.
159
+ *
160
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
161
+ */
162
+ public function logout()
163
+ {
164
+ if (!$this->checkSession()) return false;
165
+ $res=$this->get("http://bookcrossing.com/logout");
166
+ $this->debugRequest();
167
+ $this->resetDebugger();
168
+ $this->stopPlugin();
169
+ return true;
170
+ }
171
+ }?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/bordermail.plg.php ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Bordermail',
4
+ 'version'=>'1.0.3',
5
+ 'description'=>"Get the contacts from a Bordermail account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.boardermail.com/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Bordermail Plugin
15
+ *
16
+ * Imports user's contacts from Bordermail AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class bordermail extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'name="mailcom"',
30
+ 'login_post'=>'mailcomframe',
31
+ 'inbox'=>'outblaze',
32
+ 'export_page'=>'addrURL',
33
+ 'post_contacts'=>'csv',
34
+ 'file_contacts'=>'Title'
35
+ );
36
+
37
+ /**
38
+ * Login function
39
+ *
40
+ * Makes all the necessary requests to authenticate
41
+ * the current user to the server.
42
+ *
43
+ * @param string $user The current user.
44
+ * @param string $pass The password for the current user.
45
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
46
+ */
47
+ public function login($user,$pass)
48
+ {
49
+ $this->resetDebugger();
50
+ $this->service='bordermail';
51
+ $this->service_user=$user;
52
+ $this->service_password=$pass;
53
+ if (!$this->init()) return false;
54
+
55
+ $res=$this->get("http://www.mail.com/login.aspx?domain=boardermail.com&lang=en",true);
56
+
57
+ if ($this->checkResponse('initial_get',$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.mail.com/login.aspx?domain=boardermail.com&lang=en",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.mail.com/login.aspx?domain=boardermail.com&lang=en",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+ $form_action=$this->getElementString($res,'name="mailcom" action="','"');
67
+ $post_elements=array("login"=>"{$user}","password"=>"{$pass}","redirlogin"=>1,"siteselected"=>"normal");
68
+ $res=$this->post($form_action,$post_elements,true);
69
+
70
+ if ($this->checkResponse('login_post',$res))
71
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
72
+ else
73
+ {
74
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
75
+ $this->debugRequest();
76
+ $this->stopPlugin();
77
+ return false;
78
+ }
79
+ $url_redirect=$this->getElementDOM($res,"//frame[@name='mailcomframe']",'src');
80
+ $res=$this->get($url_redirect[0],true);
81
+
82
+ $this->login_ok=$url_redirect[0];
83
+ return true;
84
+ }
85
+
86
+ /**
87
+ * Get the current user's contacts
88
+ *
89
+ * Makes all the necesarry requests to import
90
+ * the current user's contacts
91
+ *
92
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
93
+ */
94
+ public function getMyContacts()
95
+ {
96
+ if (!$this->login_ok)
97
+ {
98
+ $this->debugRequest();
99
+ $this->stopPlugin();
100
+ return false;
101
+ }
102
+ else $url=$this->login_ok;
103
+ $res=$this->get($url,true);
104
+
105
+ if ($this->checkResponse('inbox',$res))
106
+ $this->updateDebugBuffer('login_post',"{$url}",'GET');
107
+ else
108
+ {
109
+ $this->updateDebugBuffer('login_post',"{$url}",'GET',false);
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+ $url_contacts=$this->getElementDOM($res,"//a[@id='addrURL']",'href');
115
+ $res=$this->get($url_contacts[0],true);
116
+
117
+ if ($this->checkResponse("export_page",$res))
118
+ {
119
+ $url_export="";
120
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
121
+ $xpath=new DOMXPath($doc);$query="//a[@href]";$data=$xpath->query($query);
122
+ foreach($data as $val)
123
+ if (strstr($val->nodeValue,"Import/Export")) $url_export=$val->getAttribute('href')."&gab=1";
124
+ $this->updateDebugBuffer('post_contacts',"{$url_contacts[0]}",'GET');
125
+ }
126
+ else
127
+ {
128
+ $this->updateDebugBuffer('post_contacts',"{$url_contacts[0]}",'GET',false);
129
+ $this->debugRequest();
130
+ $this->stopPlugin();
131
+ return false;
132
+ }
133
+ $post_elements=array("showexport"=>"showexport","action"=>"export","format"=>"csv");
134
+ $res=$this->post($url_export,$post_elements);
135
+
136
+ if ($this->checkResponse('file_contacts',$res))
137
+ {
138
+ $temp=$this->parseCSV($res);
139
+ $contacts=array();
140
+ foreach ($temp as $values)
141
+ {
142
+ $name=$values['0'].(empty($values['1'])?'':(empty($values['0'])?'':'-')."{$values['1']}").(empty($values['3'])?'':" \"{$values['3']}\"").(empty($values['2'])?'':' '.$values['2']);
143
+ if (!empty($values['4']))
144
+ $contacts[$values['4']]=(empty($name)?$values['4']:$name);
145
+ if (!empty($values['12']))
146
+ $contacts[$values['12']]=(empty($name)?$values['12']:$name);
147
+ if (!empty($values['13']))
148
+ $contacts[$values['13']]=(empty($name)?$values['13']:$name);
149
+ }
150
+
151
+ //full description
152
+ $teM=explode(PHP_EOL,$res);$arrayDescriptionFlag=explode(',',$teM[0]);
153
+ foreach($temp as $tempA)
154
+ {
155
+ $name=$tempA['0'].(empty($tempA['1'])?'':(empty($tempA['0'])?'':'-')."{$tempA['1']}").(empty($tempA['3'])?'':" \"{$tempA['3']}\"").(empty($tempA['2'])?'':' '.$tempA['2']);
156
+ foreach ($arrayDescriptionFlag as $key=>$value)
157
+ $descriptionArray[(!empty($name)?$name:(!empty($tempA[4])?$tempA[4]:false))][$value]=isset($tempA[$key])?$tempA[$key]:false;
158
+ }
159
+ //print_R($descriptionArray);
160
+
161
+ $this->updateDebugBuffer('login_post',"{$url_export}",'POST',true,$post_elements);
162
+ }
163
+ else
164
+ {
165
+ $this->updateDebugBuffer('login_post',"{$url_export}",'POST',false,$post_elements);
166
+ $this->debugRequest();
167
+ $this->stopPlugin();
168
+ return false;
169
+ }
170
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
171
+ return $descriptionArray;
172
+ }
173
+
174
+ /**
175
+ * Terminate session
176
+ *
177
+ * Terminates the current user's session,
178
+ * debugs the request and reset's the internal
179
+ * debudder.
180
+ *
181
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
182
+ */
183
+ public function logout()
184
+ {
185
+ if (!$this->checkSession()) return false;
186
+ $res=$this->get("http://www.mail.com/logout.aspx");
187
+ $this->debugRequest();
188
+ $this->resetDebugger();
189
+ $this->stopPlugin();
190
+ return true;
191
+ }
192
+
193
+ }
194
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/brazencareerist.plg.php ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from brazencareerist
3
+ * You can Write Private Messages using Brazencareerist system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Brazencareerist',
7
+ 'version'=>'1.0.3',
8
+ 'description'=>"Get the contacts from a Brazencareerist account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.brazencareerist.com/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Brazencareerist Plugin
17
+ *
18
+ * Import Friends from Brazencareerist
19
+ * You can Write Private Messages using Brazencareerist system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class brazencareerist extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'form_build_id',
33
+ 'login_post'=>'logout',
34
+ 'get_friends'=>'field-content',
35
+ 'url_send_message'=>'recipients',
36
+ 'send_message'=>'from-view-message'
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='brazencareerist';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+
56
+ if (!$this->init()) return false;
57
+
58
+ $res=$this->get("http://www.brazencareerist.com/",true);
59
+ if ($this->checkResponse("initial_get",$res))
60
+ $this->updateDebugBuffer('initial_get',"http://www.brazencareerist.com/",'GET');
61
+ else
62
+ {
63
+ $this->updateDebugBuffer('initial_get',"http://www.brazencareerist.com/",'GET',false);
64
+ $this->debugRequest();
65
+ $this->stopPlugin();
66
+ return false;
67
+ }
68
+
69
+ $form_action="http://www.brazencareerist.com/";
70
+ $post_elements=array('name'=>$user,
71
+ 'pass'=>$pass,
72
+ 'form_build_id'=>$this->getElementString($res,'name="form_build_id" id="','"'),
73
+ 'form_id'=>'user_login',
74
+ 'op'=>'Log in',
75
+ );
76
+ $res=$this->post($form_action,$post_elements,true);
77
+ if ($this->checkResponse("login_post",$res))
78
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
79
+ else
80
+ {
81
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
82
+ $this->debugRequest();
83
+ $this->stopPlugin();
84
+ return false;
85
+ }
86
+ $url_fans='http://www.brazencareerist.com/profile/'.$this->getElementString($res,'href="/profile/','"')."/fans";
87
+ $this->login_ok=$url_fans;
88
+ return true;
89
+ }
90
+
91
+ /**
92
+ * Get the current user's contacts
93
+ *
94
+ * Makes all the necesarry requests to import
95
+ * the current user's contacts
96
+ *
97
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
98
+ */
99
+ public function getMyContacts()
100
+ {
101
+ if (!$this->login_ok)
102
+ {
103
+ $this->debugRequest();
104
+ $this->stopPlugin();
105
+ return false;
106
+ }
107
+ else $url=$this->login_ok;
108
+ $res=$this->get($url);
109
+ if ($this->checkResponse("get_friends",$res))
110
+ $this->updateDebugBuffer('get_friends',$url,'GET');
111
+ else
112
+ {
113
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
114
+ $this->debugRequest();
115
+ $this->stopPlugin();
116
+ return false;
117
+ }
118
+
119
+ $contacts=array();
120
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
121
+ $xpath=new DOMXPath($doc);$query="//span[@class='field-content']";$data=$xpath->query($query);
122
+ foreach($data as $node)
123
+ {
124
+ $name=$node->nodeValue;
125
+ if (!empty($name)) $contacts[$name]=$name;
126
+ }
127
+ return $contacts;
128
+ }
129
+
130
+ /**
131
+ * Send message to contacts
132
+ *
133
+ * Sends a message to the contacts using
134
+ * the service's inernal messaging system
135
+ *
136
+ * @param string $cookie_file The location of the cookies file for the current session
137
+ * @param string $message The message being sent to your contacts
138
+ * @param array $contacts An array of the contacts that will receive the message
139
+ * @return mixed FALSE on failure.
140
+ */
141
+ public function sendMessage($session_id,$message,$contacts)
142
+ {
143
+ $countMessages=0;
144
+ foreach($contacts as $name)
145
+ {
146
+ $countMessages++;
147
+ $url_send_message="http://www.brazencareerist.com/node/add/pm";
148
+ $res=$this->get($url_send_message);
149
+ if ($this->checkResponse("url_send_message",$res))
150
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET');
151
+ else
152
+ {
153
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET',false);
154
+ $this->debugRequest();
155
+ $this->stopPlugin();
156
+ return false;
157
+ }
158
+
159
+ $form_action="http://www.brazencareerist.com/node/add/pm";
160
+ $post_elements=$this->getHiddenElements($res);
161
+ $post_elements['recipients']=$name;$post_elements['title']=$message['subject'];$post_elements['body']=$message['body'];$post_elements['op']='Send private message';$post_elements['parent']=0;
162
+ $res=$this->post($form_action,$post_elements,true);
163
+ if ($this->checkResponse("send_message",$res))
164
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
165
+ else
166
+ {
167
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
168
+ $this->debugRequest();
169
+ $this->stopPlugin();
170
+ return false;
171
+ }
172
+ sleep($this->messageDelay);
173
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
174
+ }
175
+ }
176
+
177
+ /**
178
+ * Terminate session
179
+ *
180
+ * Terminates the current user's session,
181
+ * debugs the request and reset's the internal
182
+ * debudder.
183
+ *
184
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
185
+ */
186
+ public function logout()
187
+ {
188
+ if (!$this->checkSession()) return false;
189
+ $res=$this->get("http://www.brazencareerist.com/logout");
190
+ $this->debugRequest();
191
+ $this->resetDebugger();
192
+ $this->stopPlugin();
193
+ return true;
194
+ }
195
+ }
196
+
197
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/canoe.plg.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Canoe',
4
+ 'version'=>'1.0.3',
5
+ 'description'=>"Get the contacts from a Canoe account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.canoe.ca/CanoeMail/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * Canoe Plugin
15
+ *
16
+ * Import user's contacts from Canoe account
17
+ *
18
+ *
19
+ * @author OpenInviter
20
+ * @version 1.0.0
21
+ */
22
+ class canoe extends openinviter_base
23
+ {
24
+ private $login_ok=false;
25
+ public $showContacts=true;
26
+ public $internalError=false;
27
+ protected $timeout=30;
28
+
29
+ public $debug_array=array(
30
+ 'initial_get'=>'canoeid',
31
+ 'login_post'=>'isHere',
32
+ 'url_home'=>'self.location.replace',
33
+ 'file_contacts'=>'Name',
34
+ );
35
+
36
+ /**
37
+ * Login function
38
+ *
39
+ * Makes all the necessary requests to authenticate
40
+ * the current user to the server.
41
+ *
42
+ * @param string $user The current user.
43
+ * @param string $pass The password for the current user.
44
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
45
+ */
46
+ public function login($user,$pass)
47
+ {
48
+ $this->resetDebugger();
49
+ $this->service='canoe';
50
+ $this->service_user=$user;
51
+ $this->service_password=$pass;
52
+ if (!$this->init()) return false;
53
+
54
+ $res=$this->get("http://www.canoe.ca/CanoeMail/",true);
55
+ if ($this->checkResponse("initial_get",$res))
56
+ $this->updateDebugBuffer('initial_get',"http://www.canoe.ca/CanoeMail/",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get',"http://www.canoe.ca/CanoeMail/",'GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+
65
+ $form_action="http://rapids.canoe.ca/cgi-bin/reg/mailsignup";
66
+ $post_elements=array('MODE'=>'CANOEMAIL_LOGIN',
67
+ 'LOOK'=>'CANOEMAILv2',
68
+ 'username'=>$user,
69
+ 'password'=>$pass,
70
+ 'login.x'=>rand(1,50),
71
+ 'login.y'=>rand(1,50)
72
+ );
73
+ $res=$this->post($form_action,$post_elements,true);
74
+ if ($this->checkResponse("login_post",$res))
75
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
76
+ else
77
+ {
78
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
79
+ $this->debugRequest();
80
+ $this->stopPlugin();
81
+ return false;
82
+ }
83
+
84
+ $url_file_contacts='http://www.canoemail.com/contacts/contacts_import_export.asp?action=export&app=Outlook_2000&NewContacts=true&ContactType=all';
85
+ $this->login_ok=$url_file_contacts;
86
+ return true;
87
+ }
88
+
89
+ /**
90
+ * Get the current user's contacts
91
+ *
92
+ * Makes all the necesarry requests to import
93
+ * the current user's contacts
94
+ *
95
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
96
+ */
97
+ public function getMyContacts()
98
+ {
99
+ if (!$this->login_ok)
100
+ {
101
+ $this->debugRequest();
102
+ $this->stopPlugin();
103
+ return false;
104
+ }
105
+ else $url=$this->login_ok;
106
+ $res=$this->get($url);
107
+ if ($this->checkResponse("file_contacts",$res))
108
+ $this->updateDebugBuffer('file_contacts',$url,'GET');
109
+ else
110
+ {
111
+ $this->updateDebugBuffer('file_contacts',$url,'GET',false);
112
+ $this->debugRequest();
113
+ $this->stopPlugin();
114
+ return false;
115
+ }
116
+
117
+ $contacts=array();
118
+ $temp=$this->parseCSV($res);
119
+ $contacts=array();
120
+ foreach ($temp as $values)
121
+ {
122
+ if (!empty($values[4]))
123
+ $$contacts[$values[4]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
124
+ 'middle_name'=>(!empty($values[2])?$values[2]:false),
125
+ 'last_name'=>(!empty($values[1])?$values[1]:false),
126
+ 'nickname'=>false,
127
+ 'email_1'=>(!empty($values[4])?$values[4]:false),
128
+ 'email_2'=>false,
129
+ 'email_3'=>false,
130
+ 'organization'=>false,
131
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
132
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
133
+ 'pager'=>false,
134
+ 'address_home'=>false,
135
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
136
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
137
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
138
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
139
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
140
+ 'address_work'=>false,
141
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
142
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
143
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
144
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
145
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
146
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
147
+ 'website'=>(!empty($values[12])?$values[12]:false),
148
+ 'isq_messenger'=>false,
149
+ 'skype_essenger'=>false,
150
+ 'yahoo_essenger'=>false,
151
+ 'msn_messenger'=>false,
152
+ 'aol_messenger'=>false,
153
+ 'other_messenger'=>false,
154
+ );
155
+ }
156
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
157
+ return $this->returnContacts($contacts);
158
+ }
159
+
160
+ /**
161
+ * Terminate session
162
+ *
163
+ * Terminates the current user's session,
164
+ * debugs the request and reset's the internal
165
+ * debudder.
166
+ *
167
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
168
+ */
169
+ public function logout()
170
+ {
171
+ if (!$this->checkSession()) return false;
172
+ $res=$this->get("http://www.canoemail.com/logout.asp?action=logout",true);
173
+ $this->debugRequest();
174
+ $this->resetDebugger();
175
+ $this->stopPlugin();
176
+ return true;
177
+ }
178
+ }
179
+
180
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/care2.plg.php ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Care2',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Care2 account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://passport.care2.net/login.html?promoID=1',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(care2.com)/i'),
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger')
12
+ );
13
+ /**
14
+ * Care2 Plugin
15
+ *
16
+ * Import user's contacts from Care2 account
17
+ *
18
+ *
19
+ * @author OpenInviter
20
+ * @version 1.0.2
21
+ */
22
+ class care2 extends openinviter_base
23
+ {
24
+ private $login_ok=false;
25
+ public $showContacts=true;
26
+ public $internalError=false;
27
+ protected $timeout=30;
28
+
29
+ public $debug_array=array(
30
+ 'initial_get'=>'nofollow',
31
+ 'login_post'=>'navbar-email',
32
+ 'url_home'=>'self.location.replace',
33
+ 'file_contacts'=>'Name',
34
+ );
35
+
36
+ /**
37
+ * Login function
38
+ *
39
+ * Makes all the necessary requests to authenticate
40
+ * the current user to the server.
41
+ *
42
+ * @param string $user The current user.
43
+ * @param string $pass The password for the current user.
44
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
45
+ */
46
+ public function login($user,$pass)
47
+ {
48
+ $this->resetDebugger();
49
+ $this->service='care2';
50
+ $this->service_user=$user;
51
+ $this->service_password=$pass;
52
+ if (!$this->init()) return false;
53
+
54
+ $res=$this->get("http://www.care2.com/",true);
55
+ if ($this->checkResponse("initial_get",$res))
56
+ $this->updateDebugBuffer('initial_get',"http://passport.care2.net/login.html?promoID=1",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get',"http://passport.care2.net/login.html?promoID=1",'GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+
65
+ $form_action="http://passport.care2.net/login.html?promoID=1";
66
+ $post_elements=array('promoID'=>1,
67
+ 'loginemail'=>$user,
68
+ 'password'=>$pass,
69
+ 'perm'=>'on',
70
+ 'login'=>'Log In'
71
+ );
72
+ $res=$this->post($form_action,$post_elements);
73
+ if ($this->checkResponse("login_post",$res))
74
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
75
+ else
76
+ {
77
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
78
+ $this->debugRequest();
79
+ $this->stopPlugin();
80
+ return false;
81
+ }
82
+
83
+ $res=$this->get('http://www.care2.com',true);
84
+ if ($this->checkResponse("url_home",$res))
85
+ $this->updateDebugBuffer('url_home',"http://www.care2.com/mail.html",'GET');
86
+ else
87
+ {
88
+ $this->updateDebugBuffer('url_home',"http://www.care2.com/mail.html",'GET',false);
89
+ $this->debugRequest();
90
+ $this->stopPlugin();
91
+ return false;
92
+ }
93
+ $url_file_contacts='http://mail.care2.com/contacts/contacts_import_export.asp?action=export&app=Outlook_2007&NewContacts=true&ContactType=all';
94
+ $this->login_ok=$url_file_contacts;
95
+ return true;
96
+ }
97
+
98
+ /**
99
+ * Get the current user's contacts
100
+ *
101
+ * Makes all the necesarry requests to import
102
+ * the current user's contacts
103
+ *
104
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
105
+ */
106
+ public function getMyContacts()
107
+ {
108
+ if (!$this->login_ok)
109
+ {
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+ else $url=$this->login_ok;
115
+ $res=$this->get($url);
116
+ if ($this->checkResponse("file_contacts",$res))
117
+ $this->updateDebugBuffer('file_contacts',$url,'GET');
118
+ else
119
+ {
120
+ $this->updateDebugBuffer('file_contacts',$url,'GET',false);
121
+ $this->debugRequest();
122
+ $this->stopPlugin();
123
+ return false;
124
+ }
125
+
126
+ $contacts=array();
127
+ $temp=$this->parseCSV($res);
128
+ $contacts=array();
129
+ foreach ($temp as $values)
130
+ {
131
+ if (!empty($values[2]))
132
+ $contacts[$values[2]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
133
+ 'middle_name'=>(!empty($values[2])?$values[2]:false),
134
+ 'last_name'=>(!empty($values[1])?$values[1]:false),
135
+ 'nickname'=>false,
136
+ 'email_1'=>(!empty($values[2])?$values[2]:false),
137
+ 'email_2'=>(!empty($values[3])?$values[3]:false),
138
+ 'email_3'=>false,
139
+ 'organization'=>false,
140
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
141
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
142
+ 'pager'=>false,
143
+ 'address_home'=>false,
144
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
145
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
146
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
147
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
148
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
149
+ 'address_work'=>false,
150
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
151
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
152
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
153
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
154
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
155
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
156
+ 'website'=>(!empty($values[12])?$values[12]:false),
157
+ 'isq_messenger'=>false,
158
+ 'skype_essenger'=>false,
159
+ 'yahoo_essenger'=>false,
160
+ 'msn_messenger'=>false,
161
+ 'aol_messenger'=>false,
162
+ 'other_messenger'=>false,
163
+ );
164
+ }
165
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
166
+ return $this->returnContacts($contacts);
167
+ }
168
+
169
+ /**
170
+ * Terminate session
171
+ *
172
+ * Terminates the current user's session,
173
+ * debugs the request and reset's the internal
174
+ * debudder.
175
+ *
176
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
177
+ */
178
+ public function logout()
179
+ {
180
+ if (!$this->checkSession()) return false;
181
+ $res=$this->get("http://mail.care2.com/s/care2/logout.asp",true);
182
+ $this->debugRequest();
183
+ $this->resetDebugger();
184
+ $this->stopPlugin();
185
+ return true;
186
+ }
187
+ }
188
+
189
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/clevergo.plg.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Clevergo',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Clevergo account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.clevergo.com/index.php',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger')
12
+ );
13
+ /**
14
+ * Doramail.com Plugin
15
+ *
16
+ * Imports user's contacts from Clevergo.com AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class clevergo extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+
29
+ public $debug_array=array(
30
+ 'initial_get'=>'email_local',
31
+ 'login_post'=>'sid',
32
+ 'contacts_file'=>'Firstname'
33
+
34
+ );
35
+
36
+ /**
37
+ * Login function
38
+ *
39
+ * Makes all the necessary requests to authenticate
40
+ * the current user to the server.
41
+ *
42
+ * @param string $user The current user.
43
+ * @param string $pass The password for the current user.
44
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
45
+ */
46
+ public function login($user,$pass)
47
+ {
48
+ $this->resetDebugger();
49
+ $this->service='clevergo';
50
+ $this->service_user=$user;
51
+ $this->service_password=$pass;
52
+ if (!$this->init()) return false;
53
+
54
+ $res=$this->get("http://www.clevergo.com/index.php");
55
+ if ($this->checkResponse("initial_get",$res))
56
+ $this->updateDebugBuffer('initial_get',"http://www.doramail.com/scripts/common/index.main?signin=1&lang=us",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get',"http://www.doramail.com/scripts/common/index.main?signin=1&lang=us",'GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+
65
+ $form_action="http://www.clevergo.com/index.php?action=login";
66
+ $post_elements=array('do'=>'login','email_local'=>$user,'email_domain'=>'clevergo.com','passwordMD5'=>md5($pass),'language'=>'english');
67
+ $res=$this->post($form_action,$post_elements,true);
68
+ if ($this->checkResponse('login_post',$res))
69
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
70
+ else
71
+ {
72
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
73
+ $this->debugRequest();
74
+ $this->stopPlugin();
75
+ return false;
76
+ }
77
+
78
+ $sid=$this->getElementString($res,'email.php?sid=','"');
79
+ $this->login_ok=$sid;
80
+ file_put_contents($this->getLogoutPath(),$sid);
81
+ return true;
82
+ }
83
+
84
+ /**
85
+ * Get the current user's contacts
86
+ *
87
+ * Makes all the necesarry requests to import
88
+ * the current user's contacts
89
+ *
90
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
91
+ */
92
+ public function getMyContacts()
93
+ {
94
+ if (!$this->login_ok)
95
+ {
96
+ $this->debugRequest();
97
+ $this->stopPlugin();
98
+ return false;
99
+ }
100
+ else $sid=$this->login_ok;
101
+
102
+ $form_action="http://www.clevergo.com/organizer.addressbook.php?action=exportAddressbook&sid={$sid}";
103
+ $post_elements=array('lineBreakChar'=>'lf','sepChar'=>'comma','quoteChar'=>'double');
104
+ $res=$this->post($form_action,$post_elements);
105
+ if ($this->checkResponse("contacts_file",$res))
106
+ $this->updateDebugBuffer('contacts_file',$form_action,'POST',true,$post_elements);
107
+ else
108
+ {
109
+ $this->updateDebugBuffer('contacts_file',$form_action,'POST',false,$post_elements);
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+
115
+ $temp=$this->parseCSV($res);$teM=explode(PHP_EOL,$res);$arrayDescriptionFlag=explode(',',$teM[0]);
116
+ $contacts=array();
117
+ foreach ($temp as $values)
118
+ {
119
+ if (!empty($values[9]))
120
+ $contacts[$values[9]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
121
+ 'middle_name'=>(!empty($values[2])?$values[2]:false),
122
+ 'last_name'=>(!empty($values[1])?$values[1]:false),
123
+ 'nickname'=>false,
124
+ 'email_1'=>(!empty($values[9])?$values[9]:false),
125
+ 'email_2'=>false,
126
+ 'email_3'=>false,
127
+ 'organization'=>false,
128
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
129
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
130
+ 'pager'=>false,
131
+ 'address_home'=>false,
132
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
133
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
134
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
135
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
136
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
137
+ 'address_work'=>false,
138
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
139
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
140
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
141
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
142
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
143
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
144
+ 'website'=>(!empty($values[12])?$values[12]:false),
145
+ 'isq_messenger'=>false,
146
+ 'skype_essenger'=>false,
147
+ 'yahoo_essenger'=>false,
148
+ 'msn_messenger'=>false,
149
+ 'aol_messenger'=>false,
150
+ 'other_messenger'=>false,
151
+ );
152
+ }
153
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
154
+ return $this->returnContacts($contacts);
155
+ }
156
+
157
+ /**
158
+ * Terminate session
159
+ *
160
+ * Terminates the current user's session,
161
+ * debugs the request and reset's the internal
162
+ * debudder.
163
+ *
164
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
165
+ */
166
+ public function logout()
167
+ {
168
+ if (!$this->checkSession()) return false;
169
+ if (file_exists($this->getLogoutPath()))
170
+ {
171
+ $sid=file_get_contents($this->getLogoutPath());
172
+ $res=$this->get("http://www.clevergo.com/start.php?sid={$sid}&action=logout",true);
173
+ }
174
+ $this->debugRequest();
175
+ $this->resetDebugger();
176
+ $this->stopPlugin();
177
+ return true;
178
+ }
179
+ }
180
+
181
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/cyworld.plg.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Cyworld
3
+ * You can Post Messages using Cyworld system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Cyworld',
7
+ 'version'=>'1.0.6',
8
+ 'description'=>"Get the contacts from a Cyworld account",
9
+ 'base_version'=>'1.6.3',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://us.cyworld.com/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Cyworld Plugin
17
+ *
18
+ * Import user's contacts from Flixster and Post comments
19
+ * using Flixster's internal Posting system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class cyworld extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+
30
+ public $debug_array=array(
31
+ 'initial_get'=>'Cyworld',
32
+ 'login_post'=>'MyHompy_GSP',
33
+ 'url_home'=>'selected nobg',
34
+ 'get_friends'=>'friend_message_link',
35
+ 'url_send_message'=>'MemoContent',
36
+ 'send_message'=>'replace'
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='cyworld';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("http://us.cyworld.com/",true);
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"http://us.cyworld.com/",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"http://us.cyworld.com/",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+
68
+ $form_action="http://us.cyworld.com/common/include/login_check_proc.php";
69
+ $post_elements=array("txtEmail"=>$user,
70
+ "txtPassword"=>$pass,
71
+ "hidReturnURL"=>'/',
72
+ "c.x"=>rand(1,20),
73
+ "c.y"=>rand(1,20),
74
+ );
75
+ $res=$this->post($form_action,$post_elements,true);
76
+ if ($this->checkResponse("login_post",$res))
77
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
78
+ else
79
+ {
80
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
81
+ $this->debugRequest();
82
+ $this->stopPlugin();
83
+ return false;
84
+ }
85
+
86
+ $res=$this->get('http://us.cyworld.com/');
87
+ if ($this->checkResponse("url_home",$res))
88
+ $this->updateDebugBuffer('url_home',"http://us.cyworld.com/",'GET');
89
+ else
90
+ {
91
+ $this->updateDebugBuffer('url_home',"http://us.cyworld.com/",'GET',false);
92
+ $this->debugRequest();
93
+ $this->stopPlugin();
94
+ return false;
95
+ }
96
+
97
+ $user=$this->getElementString($res,'&sign=http://us.cyworld.com/','&');
98
+ $url_profile="http://us.cyworld.com/{$user}/friend";
99
+ $this->login_ok=$url_profile;
100
+ return true;
101
+ }
102
+
103
+ /**
104
+ * Get the current user's contacts
105
+ *
106
+ * Makes all the necesarry requests to import
107
+ * the current user's contacts
108
+ *
109
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
110
+ */
111
+ public function getMyContacts()
112
+ {
113
+ if (!$this->login_ok)
114
+ {
115
+ $this->debugRequest();
116
+ $this->stopPlugin();
117
+ return false;
118
+ }
119
+ else $url=$this->login_ok;
120
+ $res=$this->get($url);
121
+ if ($this->checkResponse("get_friends",$res))
122
+ $this->updateDebugBuffer('get_friends',$url,'GET');
123
+ else
124
+ {
125
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
126
+ $this->debugRequest();
127
+ $this->stopPlugin();
128
+ return false;
129
+ }
130
+
131
+ $contacts=array();
132
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
133
+ $xpath=new DOMXPath($doc);$query="//a[@id='friend_message_link']";$data=$xpath->query($query);
134
+ foreach($data as $node)
135
+ {
136
+ $href=$node->getAttribute('href');$name=$this->getElementString($href,'/','/');$href='http://us.cyworld.com'.$href;
137
+ if ((!empty($name)) and (!empty($href))) $contacts[$href]=$name;
138
+ }
139
+ return $contacts;
140
+ }
141
+
142
+ /**
143
+ * Send message to contacts
144
+ *
145
+ * Sends a message to the contacts using
146
+ * the service's inernal messaging system
147
+ *
148
+ * @param string $cookie_file The location of the cookies file for the current session
149
+ * @param string $message The message being sent to your contacts
150
+ * @param array $contacts An array of the contacts that will receive the message
151
+ * @return mixed FALSE on failure.
152
+ */
153
+ public function sendMessage($session_id,$message,$contacts)
154
+ {
155
+ $countMessages=0;
156
+ foreach($contacts as $href=>$name)
157
+ {
158
+ $countMessages++;
159
+ $url_send_message="{$href}/message/send_message";
160
+ $res=$this->get($url_send_message);
161
+ if ($this->checkResponse("url_send_message",$res))
162
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET');
163
+ else
164
+ {
165
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET',false);
166
+ $this->debugRequest();
167
+ $this->stopPlugin();
168
+ return false;
169
+ }
170
+
171
+ $form_action="http://us.cyworld.com/main/memo_send_proc.php";
172
+ $post_elements=$this->getHiddenElements($res);$post_elements['MemoContent']=$message['body'];
173
+ $res=$this->post($form_action,$post_elements);
174
+ if ($this->checkResponse("send_message",$res))
175
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
176
+ else
177
+ {
178
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
179
+ $this->debugRequest();
180
+ $this->stopPlugin();
181
+ return false;
182
+ }
183
+ sleep($this->messageDelay);
184
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
185
+ }
186
+
187
+ }
188
+
189
+ /**
190
+ * Terminate session
191
+ *
192
+ * Terminates the current user's session,
193
+ * debugs the request and reset's the internal
194
+ * debudder.
195
+ *
196
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
197
+ */
198
+ public function logout()
199
+ {
200
+ if (!$this->checkSession()) return false;
201
+ $res=$this->get("http://us.cyworld.com/common/include/logout_proc.php");
202
+ $this->debugRequest();
203
+ $this->resetDebugger();
204
+ $this->stopPlugin();
205
+ return true;
206
+ }
207
+ }
208
+
209
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/doramail.plg.php ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Doramail',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Doramail account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.doramail.com/scripts/common/index.main?signin=1&lang=us',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger')
12
+ );
13
+ /**
14
+ * Doramail.com Plugin
15
+ *
16
+ * Imports user's contacts from Doramail.com AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class doramail extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'show_frame',
30
+ 'login_post'=>'frame',
31
+ 'url_inbox'=>'mailbox',
32
+ 'url_adressbook'=>'scripts',
33
+ 'url_export'=>'cgi',
34
+ 'export_file'=>'csv',
35
+ 'contacts_file'=>'Name'
36
+
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='doramail';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("http://www.doramail.com/scripts/common/index.main?signin=1&lang=us");
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"http://www.doramail.com/scripts/common/index.main?signin=1&lang=us",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"http://www.doramail.com/scripts/common/index.main?signin=1&lang=us",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+
68
+ $form_action="http://www.doramail.com/scripts/common/proxy.main";
69
+ $post_elements=array('show_frame'=>'Enter',
70
+ 'action'=>'login',
71
+ 'domain'=>'doramail.com',
72
+ 'mail_language'=>'us',
73
+ 'longlogin'=>1,
74
+ 'login'=>$user,
75
+ 'password'=>$pass,
76
+ );
77
+ $res=$this->post($form_action,$post_elements,true);
78
+ if ($this->checkResponse('login_post',$res))
79
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
80
+ else
81
+ {
82
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
83
+ $this->debugRequest();
84
+ $this->stopPlugin();
85
+ return false;
86
+ }
87
+
88
+ $url_frame_array=$this->getElementDOM($res,"//frame",'src');
89
+ $res=$this->get($url_frame_array[1]);
90
+ if ($this->checkResponse("url_inbox",$res))
91
+ $this->updateDebugBuffer('url_inbox',"http://www.doramail.com/scripts/common/index.main?signin=1&lang=us",'GET');
92
+ else
93
+ {
94
+ $this->updateDebugBuffer('url_inbox',"http://www.doramail.com/scripts/common/index.main?signin=1&lang=us",'GET',false);
95
+ $this->debugRequest();
96
+ $this->stopPlugin();
97
+ return false;
98
+ }
99
+
100
+ $url_inbox='http://mymail.doramail.com/scripts/mail/mailbox.mail?'.$this->getElementString($res,'/scripts/mail/mailbox.mail?','"');
101
+ $res=$this->get($url_inbox);
102
+ if ($this->checkResponse("url_adressbook",$res))
103
+ $this->updateDebugBuffer('url_adressbook',"http://www.doramail.com/scripts/common/index.main?signin=1&lang=us",'GET');
104
+ else
105
+ {
106
+ $this->updateDebugBuffer('url_adressbook',"http://www.doramail.com/scripts/common/index.main?signin=1&lang=us",'GET',false);
107
+ $this->debugRequest();
108
+ $this->stopPlugin();
109
+ return false;
110
+ }
111
+
112
+ $url_adressbook='http://mymail.doramail.com/scripts/addr/'.$this->getElementString($res,'/scripts/addr/','"');
113
+ $this->login_ok=$url_adressbook;
114
+ return true;
115
+ }
116
+
117
+ /**
118
+ * Get the current user's contacts
119
+ *
120
+ * Makes all the necesarry requests to import
121
+ * the current user's contacts
122
+ *
123
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
124
+ */
125
+ public function getMyContacts()
126
+ {
127
+ if (!$this->login_ok)
128
+ {
129
+ $this->debugRequest();
130
+ $this->stopPlugin();
131
+ return false;
132
+ }
133
+ else $url=$this->login_ok;
134
+ $res=$this->get($url);
135
+ if ($this->checkResponse("url_export",$res))
136
+ $this->updateDebugBuffer('url_export',$url,'GET');
137
+ else
138
+ {
139
+ $this->updateDebugBuffer('url_export',$url,'GET',false);
140
+ $this->debugRequest();
141
+ $this->stopPlugin();
142
+ return false;
143
+ }
144
+
145
+ $url_export='http://mymail.doramail.com/scripts/addr/external.cgi?'.$this->getElementString($res,'http://mymail.doramail.com/scripts/addr/external.cgi?','"');
146
+ $res=$this->get($url_export);
147
+ if ($this->checkResponse("export_file",$res))
148
+ $this->updateDebugBuffer('export_file',$url,'GET');
149
+ else
150
+ {
151
+ $this->updateDebugBuffer('export_file',$url,'GET',false);
152
+ $this->debugRequest();
153
+ $this->stopPlugin();
154
+ return false;
155
+ }
156
+ $form_action=$url_export;
157
+ $post_elements=$this->getHiddenElements($res);$post_elements['format']='csv';
158
+ $res=$this->post($form_action,$post_elements);
159
+ if ($this->checkResponse("contacts_file",$res))
160
+ $this->updateDebugBuffer('contacts_file',$form_action,'POST',true,$post_elements);
161
+ else
162
+ {
163
+ $this->updateDebugBuffer('contacts_file',$form_action,'POST',false,$post_elements);
164
+ $this->debugRequest();
165
+ $this->stopPlugin();
166
+ return false;
167
+ }
168
+ $temp=$this->parseCSV($res);
169
+ $contacts=array();
170
+ foreach ($temp as $values)
171
+ {
172
+ if (!empty($values[4]))
173
+ $contacts[$values[4]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
174
+ 'middle_name'=>(!empty($values[2])?$values[2]:false),
175
+ 'last_name'=>(!empty($values[1])?$values[1]:false),
176
+ 'nickname'=>false,
177
+ 'email_1'=>(!empty($values[4])?$values[4]:false),
178
+ 'email_2'=>false,
179
+ 'email_3'=>false,
180
+ 'organization'=>false,
181
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
182
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
183
+ 'pager'=>false,
184
+ 'address_home'=>false,
185
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
186
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
187
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
188
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
189
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
190
+ 'address_work'=>false,
191
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
192
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
193
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
194
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
195
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
196
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
197
+ 'website'=>(!empty($values[12])?$values[12]:false),
198
+ 'isq_messenger'=>false,
199
+ 'skype_essenger'=>false,
200
+ 'yahoo_essenger'=>false,
201
+ 'msn_messenger'=>false,
202
+ 'aol_messenger'=>false,
203
+ 'other_messenger'=>false,
204
+ );
205
+ }
206
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
207
+ return $this->returnContacts($contacts);
208
+ }
209
+
210
+ /**
211
+ * Terminate session
212
+ *
213
+ * Terminates the current user's session,
214
+ * debugs the request and reset's the internal
215
+ * debudder.
216
+ *
217
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
218
+ */
219
+ public function logout()
220
+ {
221
+ if (!$this->checkSession()) return false;
222
+ $res=$this->get('http://mymail.doramail.com/scripts/mail/Outblaze.mail?logout=1&.noframe=1&a=1&',true);
223
+ $this->debugRequest();
224
+ $this->resetDebugger();
225
+ $this->stopPlugin();
226
+ return true;
227
+ }
228
+
229
+ }
230
+
231
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/eons.plg.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from eons
3
+ * You can Write Private Messages using Brazencareerist system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Eons',
7
+ 'version'=>'1.0.4',
8
+ 'description'=>"Get the contacts from a Eons account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.eons.com/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Eons Plugin
17
+ *
18
+ * Import Friends from Eons
19
+ * You can Write Private Messages using Eons system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class eons extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'account[username]',
33
+ 'login_post'=>'com/logout',
34
+ 'url_home'=>'/members/friends/',
35
+ 'get_friends'=>'cont-image member-card',
36
+ 'send_message'=>'sent'
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='eons';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+
56
+ if (!$this->init()) return false;
57
+
58
+ $res=$this->get("http://www.eons.com/",true);
59
+ if ($this->checkResponse("initial_get",$res))
60
+ $this->updateDebugBuffer('initial_get',"http://www.eons.com/",'GET');
61
+ else
62
+ {
63
+ $this->updateDebugBuffer('initial_get',"http://www.eons.com/",'GET',false);
64
+ $this->debugRequest();
65
+ $this->stopPlugin();
66
+ return false;
67
+ }
68
+
69
+ $form_action="https://www.eons.com/login";
70
+ $post_elements=array('resource'=>'http://www.eons.com/','account[username]'=>$user,'account[password]'=>$pass,'permanent'=>1,'commit'=>'Log in');
71
+ $res=$this->post($form_action,$post_elements,true);
72
+ if ($this->checkResponse("login_post",$res))
73
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
74
+ else
75
+ {
76
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
77
+ $this->debugRequest();
78
+ $this->stopPlugin();
79
+ return false;
80
+ }
81
+
82
+ $url_home="http://www.eons.com/my_eons";
83
+ $res=$this->get($url_home,true);
84
+ if ($this->checkResponse("url_home",$res))
85
+ $this->updateDebugBuffer('url_home',$url_home,'GET');
86
+ else
87
+ {
88
+ $this->updateDebugBuffer('url_home',$url_home,'GET',false);
89
+ $this->debugRequest();
90
+ $this->stopPlugin();
91
+ return false;
92
+ }
93
+
94
+ $url_friends='http://www.eons.com/members/friends/'.$this->getElementString($res,'/members/friends/','"');
95
+ $this->login_ok=$url_friends;
96
+ return true;
97
+ }
98
+
99
+ /**
100
+ * Get the current user's contacts
101
+ *
102
+ * Makes all the necesarry requests to import
103
+ * the current user's contacts
104
+ *
105
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
106
+ */
107
+ public function getMyContacts()
108
+ {
109
+ if (!$this->login_ok)
110
+ {
111
+ $this->debugRequest();
112
+ $this->stopPlugin();
113
+ return false;
114
+ }
115
+ else $url=$this->login_ok;
116
+ $res=$this->get($url);
117
+ if ($this->checkResponse("get_friends",$res))
118
+ $this->updateDebugBuffer('get_friends',$url,'GET');
119
+ else
120
+ {
121
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
122
+ $this->debugRequest();
123
+ $this->stopPlugin();
124
+ return false;
125
+ }
126
+
127
+ $contacts=array();
128
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
129
+ $xpath=new DOMXPath($doc);$query="//div[@class='cont-image member-card']";$data=$xpath->query($query);
130
+ foreach($data as $node)
131
+ {
132
+ $name=$node->childNodes->item(3)->childNodes->item(1)->nodeValue;
133
+ if (!empty($name)) $contacts[$name]=!empty($name)?$name:false;
134
+ }
135
+ return $contacts;
136
+ }
137
+
138
+ /**
139
+ * Send message to contacts
140
+ *
141
+ * Sends a message to the contacts using
142
+ * the service's inernal messaging system
143
+ *
144
+ * @param string $cookie_file The location of the cookies file for the current session
145
+ * @param string $message The message being sent to your contacts
146
+ * @param array $contacts An array of the contacts that will receive the message
147
+ * @return mixed FALSE on failure.
148
+ */
149
+ public function sendMessage($session_id,$message,$contacts)
150
+ {
151
+ $countMessages=0;
152
+ foreach($contacts as $name)
153
+ {
154
+ $countMessages++;
155
+ $form_action="http://www.eons.com/messages/write";
156
+ $post_elements=array('ref'=>"http://www.eons.com/members/profile/{$name}",
157
+ 'msg[recipient_name]'=>$name,
158
+ 'msg[subject]'=>$message['subject'],
159
+ 'msg[body]'=>$message['body'],
160
+ 'commit'=>'Send Message'
161
+ );
162
+ $res=$this->post($form_action,$post_elements,true);
163
+ if ($this->checkResponse("send_message",$res))
164
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
165
+ else
166
+ {
167
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
168
+ $this->debugRequest();
169
+ $this->stopPlugin();
170
+ return false;
171
+ }
172
+ sleep($this->messageDelay);
173
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
174
+ }
175
+
176
+ }
177
+
178
+ /**
179
+ * Terminate session
180
+ *
181
+ * Terminates the current user's session,
182
+ * debugs the request and reset's the internal
183
+ * debudder.
184
+ *
185
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
186
+ */
187
+ public function logout()
188
+ {
189
+ if (!$this->checkSession()) return false;
190
+ $res=$this->get("https://www.eons.com/logout");
191
+ $this->debugRequest();
192
+ $this->resetDebugger();
193
+ $this->stopPlugin();
194
+ return true;
195
+ }
196
+ }
197
+
198
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/evite.plg.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Evite',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from an Evite account",
6
+ 'base_version'=>'1.6.7',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.evite.com/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>array('/(evite.com)/i'),
11
+ 'imported_details'=>array('first_name','last_name','email_1'),
12
+ );
13
+ /**
14
+ * Evite Plugin
15
+ *
16
+ * Imports user's contacts from Evite's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.1
20
+ */
21
+ class evite extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ protected $timeout=30;
26
+ public $debug_array=array(
27
+ 'initial_get'=>'submitForm',
28
+ 'login_post'=>'Log out',
29
+ 'get_contacts'=>'abCheck'
30
+ );
31
+
32
+ /**
33
+ * Login function
34
+ *
35
+ * Makes all the necessary requests to authenticate
36
+ * the current user to the server.
37
+ *
38
+ * @param string $user The current user.
39
+ * @param string $pass The password for the current user.
40
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
41
+ */
42
+ public function login($user,$pass)
43
+ {
44
+ $this->resetDebugger();
45
+ $this->service='evite';
46
+ $this->service_user=$user;
47
+ $this->service_password=$pass;
48
+ if (!$this->init()) return false;
49
+ $res=$this->get("http://www.evite.com/loginRegForm?redirect=/pages/addrbook/contactList.jsp",true);
50
+ if ($this->checkResponse('initial_get',$res))
51
+ $this->updateDebugBuffer('initial_get',"http://www.evite.com/loginRegForm?redirect=/pages/addrbook/contactList.jsp",'GET');
52
+ else
53
+ {
54
+ $this->updateDebugBuffer('initial_get',"http://www.evite.com/loginRegForm?redirect=/pages/addrbook/contactList.jsp",'GET',false);
55
+ $this->debugRequest();
56
+ $this->stopPlugin();
57
+ return false;
58
+ }
59
+
60
+ $form_action="http://www.evite.com/loginRegForm";
61
+ $post_elements=array('cmd'=>'login','submitForm'=>'true','redirect'=>'http://www.evite.com/pages/addrbook/contactList.jsp','emailLogin'=>$user,'passLogin'=>$pass,'rememberMe'=>'on');
62
+ $res=$this->post($form_action,$post_elements,true);
63
+ if ($this->checkResponse("login_post",$res))
64
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
65
+ else
66
+ {
67
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
68
+ $this->debugRequest();
69
+ $this->stopPlugin();
70
+ return false;
71
+ }
72
+
73
+ $this->login_ok="http://www.evite.com/pages/addrbook/contactList.jsp";
74
+ return true;
75
+ }
76
+
77
+ /**
78
+ * Get the current user's contacts
79
+ *
80
+ * Makes all the necesarry requests to import
81
+ * the current user's contacts
82
+ *
83
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
84
+ */
85
+ public function getMyContacts()
86
+ {
87
+ if (!$this->login_ok)
88
+ {
89
+ $this->debugRequest();
90
+ $this->stopPlugin();
91
+ return false;
92
+ }
93
+ else $url = $this->login_ok;
94
+ $res=$this->get($url);
95
+ if ($this->checkResponse('get_contacts',$res))
96
+ $this->updateDebugBuffer('get_contacts',"http://www.evite.com/loginRegForm?redirect=/pages/addrbook/contactList.jsp",'GET');
97
+ else
98
+ {
99
+ $this->updateDebugBuffer('get_contacts',"http://www.evite.com/loginRegForm?redirect=/pages/addrbook/contactList.jsp",'GET',false);
100
+ $this->debugRequest();
101
+ $this->stopPlugin();
102
+ return false;
103
+ }
104
+
105
+ $contacts=array();
106
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
107
+ $xpath=new DOMXPath($doc);$query="//td[@class='abCheck']";$data=$xpath->query($query);$name="";
108
+ foreach ($data as $node)
109
+ {
110
+ if ($node->getAttribute('style')=='padding-left:0px;width:149px;') $name.=" ".trim($node->nodeValue);
111
+ if ($node->getAttribute('style')=='width:219px;') {$email=trim((string)$node->nodeValue);$contacts[$email]=array('first_name'=>$name,'email_1'=>$email);$name="";}
112
+ }
113
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
114
+ return $this->returnContacts($contacts);
115
+ }
116
+
117
+ /**
118
+ * Terminate session
119
+ *
120
+ * Terminates the current user's session,
121
+ * debugs the request and reset's the internal
122
+ * debudder.
123
+ *
124
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
125
+ */
126
+ public function logout()
127
+ {
128
+ if (!$this->checkSession()) return false;
129
+ $logout_url="http://www.evite.com/logout?linkTagger=header";
130
+ $res = $this->get($logout_url,true);
131
+ $this->debugRequest();
132
+ $this->resetDebugger();
133
+ $this->stopPlugin();
134
+ return true;
135
+ }
136
+ }
137
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/facebook.plg.php ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Facebook
3
+ * You can send message to your Friends Inbox
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Facebook',
7
+ 'version'=>'1.2.4',
8
+ 'description'=>"Get the contacts from a Facebook account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://apps.facebook.com/causes/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * FaceBook Plugin
17
+ *
18
+ * Imports user's contacts from FaceBook and sends
19
+ * messages using FaceBook's internal system.
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.8
23
+ */
24
+ class facebook extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+ protected $userId;
31
+
32
+ public $debug_array=array(
33
+ 'initial_get'=>'pass',
34
+ 'login_post'=>'javascripts',
35
+ 'get_user_id'=>'profile.php?id=',
36
+ 'url_friends'=>'fb_dtsg:"',
37
+ 'message_elements'=>'composer_id',
38
+ 'send_message'=>'"error":0',
39
+ );
40
+
41
+ /**
42
+ * Login function
43
+ *
44
+ * Makes all the necessary requests to authenticate
45
+ * the current user to the server.
46
+ *
47
+ * @param string $user The current user.
48
+ * @param string $pass The password for the current user.
49
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
50
+ */
51
+ public function login($user,$pass)
52
+ {
53
+ $this->resetDebugger();
54
+ $this->service='facebook';
55
+ $this->service_user=$user;
56
+ $this->service_password=$pass;
57
+ if (!$this->init()) return false;
58
+
59
+ $res=$this->get("http://apps.facebook.com/causes/",true);
60
+ if ($this->checkResponse("initial_get",$res))
61
+ $this->updateDebugBuffer('initial_get',"http://apps.facebook.com/causes/",'GET');
62
+ else
63
+ {
64
+ $this->updateDebugBuffer('initial_get',"http://apps.facebook.com/causes/",'GET',false);
65
+ $this->debugRequest();
66
+ $this->stopPlugin();
67
+ return false;
68
+ }
69
+
70
+ $form_action="https://login.facebook.com/login.php?login_attempt=1";
71
+ $post_elements=array('email'=>$user,
72
+ 'pass'=>$pass,
73
+ 'next'=>'http://apps.facebook.com/causes/home?_method=GET',
74
+ 'return_session'=>0,
75
+ 'req_perms'=>0,
76
+ 'session_key_only'=>0,
77
+ 'api_key'=>$this->getElementString($res,'name="api_key" value="','"'),
78
+ 'version'=>'1.0',
79
+ );
80
+ $res=$this->post($form_action,$post_elements,true,true);
81
+ if ($this->checkResponse("login_post",$res))
82
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
83
+ else
84
+ {
85
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
86
+ $this->debugRequest();
87
+ $this->stopPlugin();
88
+ return false;
89
+ }
90
+
91
+ $res=$this->get('http://facebook.com/',true);
92
+ if ($this->checkResponse("get_user_id",$res))
93
+ $this->updateDebugBuffer('get_user_id',"http://facebook.com/",'GET');
94
+ else
95
+ {
96
+ $this->updateDebugBuffer('get_user_id',"http://facebook.com/",'GET',false);
97
+ $this->debugRequest();
98
+ $this->stopPlugin();
99
+ return false;
100
+ }
101
+ $this->userId=$this->getElementString($res,"www.facebook.com\/profile.php?id=",'\"');
102
+ if (empty($this->userId)) $this->login_ok=false;
103
+ else $this->login_ok="http://www.facebook.com/ajax/social_graph/fetch.php?__a=1";
104
+ return true;
105
+ }
106
+
107
+ /**
108
+ * Get the current user's contacts
109
+ *
110
+ * Makes all the necesarry requests to import
111
+ * the current user's contacts
112
+ *
113
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
114
+ */
115
+ public function getMyContacts()
116
+ {
117
+ if (!$this->login_ok)
118
+ {
119
+ $this->debugRequest();
120
+ $this->stopPlugin();
121
+ return false;
122
+ }
123
+ else $url=$this->login_ok;
124
+
125
+ $res=$this->get("http://www.facebook.com/profile.php?id={$this->userId}&ref=profile",true);
126
+ if ($this->checkResponse("url_friends",$res))
127
+ $this->updateDebugBuffer('url_friends',"http://www.facebook.com/profile.php?id={$this->userId}&ref=profile",'GET');
128
+ else
129
+ {
130
+ $this->updateDebugBuffer('url_friends',"http://www.facebook.com/profile.php?id={$this->userId}&ref=profile",'GET',false);
131
+ $this->debugRequest();
132
+ $this->stopPlugin();
133
+ return false;
134
+ }
135
+ $postFormId=$this->getElementString($res,'name="post_form_id" value="','"');
136
+ $fbDtsg=$this->getElementString($res,'fb_dtsg:"','"');
137
+ $page=0;
138
+ $form_action=$this->login_ok;
139
+ $post_elements=array('edge_type'=>'browse',
140
+ 'page'=>$page,
141
+ 'limit'=>100,
142
+ 'node_id'=>$this->userId,
143
+ 'class'=>'FriendManager',
144
+ 'post_form_id'=>$postFormId,
145
+ 'fb_dtsg'=>$fbDtsg,
146
+ 'post_form_id_source'=>'AsyncReques',
147
+ );
148
+ $res=$this->post($form_action,$post_elements,true);
149
+ //!!!
150
+
151
+ $contacts=array();
152
+ while(preg_match_all("#\{\"id\"\:(.+)\,\"title\"\:\"(.+)\"#U",$res,$matches))
153
+ {
154
+ $page++;
155
+ $post_elements=array('edge_type'=>'browse',
156
+ 'page'=>$page,
157
+ 'limit'=>100,
158
+ 'node_id'=>$this->userId,
159
+ 'class'=>'FriendManager',
160
+ 'post_form_id'=>$postFormId,
161
+ 'fb_dtsg'=>$fbDtsg,
162
+ 'post_form_id_source'=>'AsyncReques',
163
+ );
164
+ $res=$this->post($form_action,$post_elements);
165
+ if (!empty($matches[1]))
166
+ foreach($matches[1] as $key=>$fbId)
167
+ if (!empty($matches[2][$key])) $contacts[$fbId]=$matches[2][$key];
168
+ }
169
+ return $contacts;
170
+ }
171
+
172
+ /**
173
+ * Send message to contacts
174
+ *
175
+ * Sends a message to the contacts using
176
+ * the service's inernal messaging system
177
+ *
178
+ * @param string $session_id The OpenInviter user's session ID
179
+ * @param string $message The message being sent to your contacts
180
+ * @param array $contacts An array of the contacts that will receive the message
181
+ * @return mixed FALSE on failure.
182
+ */
183
+ public function sendMessage($session_id,$message,$contacts)
184
+ {
185
+ $countMessages=0;
186
+ $res=$this->get('http://www.facebook.com/home.php?#!/?sk=messages',true);
187
+ if ($this->checkResponse("message_elements",$res))
188
+ $this->updateDebugBuffer('message_elements',"http://www.facebook.com/home.php?#!/?sk=messages",'GET');
189
+ else
190
+ {
191
+ $this->updateDebugBuffer('message_elements',"http://www.facebook.com/home.php?#!/?sk=messages",'GET',false);
192
+ $this->debugRequest();
193
+ $this->stopPlugin();
194
+ return false;
195
+ }
196
+ $composerId=$this->getElementString($res,'"composer_id\" value=\"','\"');
197
+ $postFormId=$this->getElementString($res,'name="post_form_id" value="','"');
198
+ $userId=$this->getElementString($res,"www.facebook.com\/profile.php?id=",'\"');
199
+ $fbDtsg=$this->getElementString($res,'fb_dtsg:"','"');
200
+ $res=$this->get("http://www.facebook.com/gigaboxx/dialog/MessageComposer.php?__a=1&__d=1",true);
201
+
202
+ $form_action="http://www.facebook.com/ajax/gigaboxx/endpoint/MessageComposerEndpoint.php?__a=1";
203
+ $post_elements=array();
204
+ foreach($contacts as $fbId=>$name)
205
+ {
206
+ $post_elements["ids_{$composerId}[$countMessages]"]=$fbId;
207
+ $post_elements["ids[$countMessages]"]=$fbId;
208
+ $countMessages++;
209
+ if ($countMessages>$this->maxMessages) break;
210
+ }
211
+ $post_elements+=array('subject'=>$message['subject'],
212
+ 'status'=>$message['body'],
213
+ 'action'=>'send_new',
214
+ 'home_tab_id'=>1,
215
+ 'profile_id'=>$userId,
216
+ 'target_id'=>0,
217
+ 'composer_id'=>$composerId,
218
+ 'hey_kid_im_a_composer'=>'true',
219
+ 'post_form_id'=>$postFormId,
220
+ 'fb_dtsg'=>$fbDtsg,
221
+ '_log_action'=>'send_new',
222
+ 'ajax_log'=>1,
223
+ 'post_form_id_source'=>'AsyncRequest'
224
+ );
225
+ $res=$this->post($form_action,$post_elements);
226
+ if ($this->checkResponse("send_message",$res))
227
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
228
+ else
229
+ {
230
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
231
+ $this->debugRequest();
232
+ $this->stopPlugin();
233
+ return false;
234
+ }
235
+ }
236
+
237
+ /**
238
+ * Terminate session
239
+ *
240
+ * Terminates the current user's session,
241
+ * debugs the request and reset's the internal
242
+ * debudder.
243
+ *
244
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
245
+ */
246
+ public function logout()
247
+ {
248
+ if (!$this->checkSession()) return false;
249
+ $res=$this->get("http://www.facebook.com/home.php",true);
250
+ if (!empty($res)) $res=$this->get('http://www.facebook.com/logout.php?h='.html_entity_decode($this->getElementString($res,'http://www.facebook.com/logout.php?h=','"')));
251
+ $this->debugRequest();
252
+ $this->resetDebugger();
253
+ $this->stopPlugin();
254
+ return true;
255
+ }
256
+ }
257
+
258
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/faces.plg.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Faces
3
+ * You can Write Private Messages using Faces system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Faces',
7
+ 'version'=>'1.0.5',
8
+ 'description'=>"Get the contacts from a Faces account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.faces.com/',
12
+ 'requirement'=>'user',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Faces Plugin
17
+ *
18
+ * Import Friends from Faces
19
+ * You can Write Private Messages using Faces system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class faces extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'loginName',
33
+ 'login_post'=>'logout',
34
+ 'get_friends'=>'name',
35
+ 'send_message'=>'Inbox'
36
+ );
37
+
38
+ /**
39
+ * Login function
40
+ *
41
+ * Makes all the necessary requests to authenticate
42
+ * the current user to the server.
43
+ *
44
+ * @param string $user The current user.
45
+ * @param string $pass The password for the current user.
46
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
47
+ */
48
+ public function login($user,$pass)
49
+ {
50
+ $this->resetDebugger();
51
+ $this->service='faces';
52
+ $this->service_user=$user;
53
+ $this->service_password=$pass;
54
+ if (!$this->init()) return false;
55
+
56
+ $res=$this->get("http://www.faces.com/",true);
57
+ if ($this->checkResponse("initial_get",$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.faces.com/",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.faces.com/",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+
67
+ $form_action="http://www.faces.com/login";
68
+ $post_elements=array('loginName'=>$user,
69
+ 'password'=>$pass,
70
+ 'action'=>'log in'
71
+ );
72
+ $res=$this->post($form_action,$post_elements,true);
73
+ if ($this->checkResponse("login_post",$res))
74
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
75
+ else
76
+ {
77
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
78
+ $this->debugRequest();
79
+ $this->stopPlugin();
80
+ return false;
81
+ }
82
+ $url_friends='http://www.faces.com/friends';
83
+ $this->login_ok=$url_friends;
84
+ return true;
85
+ }
86
+
87
+ /**
88
+ * Get the current user's contacts
89
+ *
90
+ * Makes all the necesarry requests to import
91
+ * the current user's contacts
92
+ *
93
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
94
+ */
95
+ public function getMyContacts()
96
+ {
97
+ if (!$this->login_ok)
98
+ {
99
+ $this->debugRequest();
100
+ $this->stopPlugin();
101
+ return false;
102
+ }
103
+ else $url=$this->login_ok;
104
+ $res=$this->get($url);
105
+ if ($this->checkResponse("get_friends",$res))
106
+ $this->updateDebugBuffer('get_friends',$url,'GET');
107
+ else
108
+ {
109
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+
115
+ $contacts=array();
116
+ $names_array=$this->getElementDOM($res,"//a[@class='name']");
117
+ if (!empty($names_array))
118
+ foreach($names_array as $key=>$value) $contacts[$value]=$value;
119
+ return $contacts;
120
+ }
121
+
122
+ /**
123
+ * Send message to contacts
124
+ *
125
+ * Sends a message to the contacts using
126
+ * the service's inernal messaging system
127
+ *
128
+ * @param string $cookie_file The location of the cookies file for the current session
129
+ * @param string $message The message being sent to your contacts
130
+ * @param array $contacts An array of the contacts that will receive the message
131
+ * @return mixed FALSE on failure.
132
+ */
133
+ public function sendMessage($session_id,$message,$contacts)
134
+ {
135
+ $form_action="http://www.faces.com/mailbox/compose";
136
+ $post_elements=array('scoop'=>'scoop',
137
+ 'subject'=>$message['subject'],
138
+ 'message'=>$message['body'],
139
+ 'send'=>'Send'
140
+ );
141
+ $res=$this->post($form_action,$post_elements,true);
142
+ if ($this->checkResponse("send_message",$res))
143
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
144
+ else
145
+ {
146
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
147
+ $this->debugRequest();
148
+ $this->stopPlugin();
149
+ return false;
150
+ }
151
+ }
152
+
153
+ /**
154
+ * Terminate session
155
+ *
156
+ * Terminates the current user's session,
157
+ * debugs the request and reset's the internal
158
+ * debudder.
159
+ *
160
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
161
+ */
162
+ public function logout()
163
+ {
164
+ if (!$this->checkSession()) return false;
165
+ $res=$this->get("http://www.faces.com/logout");
166
+ $this->debugRequest();
167
+ $this->resetDebugger();
168
+ $this->stopPlugin();
169
+ return true;
170
+ }
171
+ }
172
+
173
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/famiva.plg.php ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Famiva
3
+ * You can Write Private Messages using Famiva system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Famiva',
7
+ 'version'=>'1.0.3',
8
+ 'description'=>"Get the contacts from a Famiva account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.famiva.com/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Famiva Plugin
17
+ *
18
+ * Import Friends from Famiva
19
+ * You can Write Private Messages using Famiva system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class famiva extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'member[email]',
33
+ 'login_post'=>'logout',
34
+ 'get_friends'=>'data',
35
+ );
36
+
37
+ /**
38
+ * Login function
39
+ *
40
+ * Makes all the necessary requests to authenticate
41
+ * the current user to the server.
42
+ *
43
+ * @param string $user The current user.
44
+ * @param string $pass The password for the current user.
45
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
46
+ */
47
+ public function login($user,$pass)
48
+ {
49
+ $this->resetDebugger();
50
+ $this->service='famiva';
51
+ $this->service_user=$user;
52
+ $this->service_password=$pass;
53
+ if (!$this->init()) return false;
54
+
55
+ $res=$this->get("http://www.famiva.com/",true);
56
+ if ($this->checkResponse("initial_get",$res))
57
+ $this->updateDebugBuffer('initial_get',"http://www.famiva.com/",'GET');
58
+ else
59
+ {
60
+ $this->updateDebugBuffer('initial_get',"http://www.famiva.com/",'GET',false);
61
+ $this->debugRequest();
62
+ $this->stopPlugin();
63
+ return false;
64
+ }
65
+
66
+ $form_action="http://famiva.com/login/login";
67
+ $post_elements=array('member[email]'=>$user,
68
+ 'member[password]'=>$pass,
69
+ 'remember_me'=>true,
70
+ 'commit'=>'Login'
71
+ );
72
+ $res=$this->post($form_action,$post_elements,true);
73
+ if ($this->checkResponse("login_post",$res))
74
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
75
+ else
76
+ {
77
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
78
+ $this->debugRequest();
79
+ $this->stopPlugin();
80
+ return false;
81
+ }
82
+ $url_friends='http://famiva.com/members/explore';
83
+ $this->login_ok=$url_friends;
84
+ return true;
85
+ }
86
+
87
+ /**
88
+ * Get the current user's contacts
89
+ *
90
+ * Makes all the necesarry requests to import
91
+ * the current user's contacts
92
+ *
93
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
94
+ */
95
+ public function getMyContacts()
96
+ {
97
+ if (!$this->login_ok)
98
+ {
99
+ $this->debugRequest();
100
+ $this->stopPlugin();
101
+ return false;
102
+ }
103
+ else $url=$this->login_ok;
104
+ $res=$this->get($url);
105
+ if ($this->checkResponse("get_friends",$res))
106
+ $this->updateDebugBuffer('get_friends',$url,'GET');
107
+ else
108
+ {
109
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+
115
+ $contacts=array();
116
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
117
+ $xpath=new DOMXPath($doc);$query="//a";$data=$xpath->query($query);
118
+ foreach($data as $node)
119
+ if (strpos($node->getAttribute('href'),'profiles/view')!=false)
120
+ {
121
+ $name=$node->nodeValue;
122
+ $email=$node->parentNode->nextSibling->nextSibling->nodeValue;
123
+ if (!empty($email)) $contacts[$email]=!empty($name)?$name:false;
124
+ }
125
+ if (isset($contacts[$this->service_user])) unset($contacts[$this->service_user]);
126
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
127
+ return $contacts;
128
+ }
129
+
130
+ /**
131
+ * Terminate session
132
+ *
133
+ * Terminates the current user's session,
134
+ * debugs the request and reset's the internal
135
+ * debudder.
136
+ *
137
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
138
+ */
139
+ public function logout()
140
+ {
141
+ if (!$this->checkSession()) return false;
142
+ $res=$this->get("http://www.famiva.com/login/logout");
143
+ $this->debugRequest();
144
+ $this->resetDebugger();
145
+ $this->stopPlugin();
146
+ return true;
147
+ }
148
+ }
149
+
150
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/fastmail.plg.php ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'FastMail',
4
+ 'version'=>'1.0.8',
5
+ 'description'=>"Get the contacts from a FastMail account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.fastmail.fm',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(fastmail.fm)/i'),
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * FastMail Plugin
15
+ *
16
+ * Imports user's contacts from FastMail's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class fastmail extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'FLN-LoginMode',
30
+ 'post_login'=>'redirected',
31
+ 'url_webinterface'=>'kbshortcut',
32
+ 'url_get_webinterface'=>'kbshortcut',
33
+ 'contacts_page'=>'MC-From',
34
+ 'contacts_file'=>'Title',
35
+ );
36
+
37
+ /**
38
+ * Login function
39
+ *
40
+ * Makes all the necessary requests to authenticate
41
+ * the current user to the server.
42
+ *
43
+ * @param string $user The current user.
44
+ * @param string $pass The password for the current user.
45
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
46
+ */
47
+ public function login($user,$pass)
48
+ {
49
+ $this->resetDebugger();
50
+ $this->service='fastmail';
51
+ $this->service_user=$user;
52
+ $this->service_password=$pass;
53
+ if (!$this->init()) return false;
54
+
55
+ $res=$this->get("http://www.fastmail.fm/");
56
+
57
+ if ($this->checkResponse('initial_get',$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.fastmail.fm/",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.fastmail.fm/",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+
67
+ $form_action=$this->getElementString($res,'action="','"');
68
+ $post_elements=array('MLS'=>'=LN-*',
69
+ 'FLN-LoginMode'=>0,
70
+ 'FLN-UserName'=>$user,
71
+ 'FLN-Password'=>$pass,
72
+ 'MSignal_LN-AU*'=>'Login',
73
+ 'FLN-Security'=>0,
74
+ 'FLN-ScreenSize'=>3,
75
+ 'FLN-SessionTime'=>1800,
76
+ 'FLN-NoCache'=>'on'
77
+
78
+ );
79
+ $res=$this->post($form_action,$post_elements,TRUE);
80
+ if ($this->checkResponse('post_login',$res))
81
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',true,$post_elements);
82
+ else
83
+ {
84
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',false,$post_elements);
85
+ $this->debugRequest();
86
+ $this->stopPlugin();
87
+ return false;
88
+ }
89
+
90
+
91
+ if (strpos($res,'ChooseWeb-*')!==false)
92
+ {
93
+ $form_action=$this->getElementString($res,'post" action="','"');
94
+ $post_elements=$this->getHiddenElements($res);$post_elements['FChooseWeb-WebInterface']=2;
95
+ $res=$this->post($form_action,$post_elements,true);
96
+ if ($this->checkResponse('url_webinterface',$res))
97
+ $this->updateDebugBuffer('url_webinterface',"{$form_action}",'POST',true,$post_elements);
98
+ else
99
+ {
100
+ $this->updateDebugBuffer('url_webinterface',"{$form_action}",'POST',false,$post_elements);
101
+ $this->debugRequest();
102
+ $this->stopPlugin();
103
+ return false;
104
+ }
105
+ }
106
+ else
107
+ {
108
+ $url_redirect=$this->getElementString($res,'href="','"');
109
+ $res=$this->get($url_redirect,true);
110
+ if ($this->checkResponse('url_get_webinterface',$res))
111
+ $this->updateDebugBuffer('url_get_webinterface',"{$url_redirect}","GET",'GET');
112
+ else
113
+ {
114
+ $this->updateDebugBuffer('url_get_webinterface',"{$url_redirect}","GET",'GET',false);
115
+ $this->debugRequest();
116
+ $this->stopPlugin();
117
+ return false;
118
+ }
119
+ }
120
+
121
+ $url_adress_book=$this->getElementDOM($res,"//a[@kbshortcut='b']",'href');
122
+ $url_adress="http://www.fastmail.fm".$url_adress_book[0];
123
+ file_put_contents($this->getLogoutPath(),$url_adress);
124
+ $this->login_ok=$url_adress;
125
+ return true;
126
+ }
127
+
128
+ /**
129
+ * Get the current user's contacts
130
+ *
131
+ * Makes all the necesarry requests to import
132
+ * the current user's contacts
133
+ *
134
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
135
+ */
136
+ public function getMyContacts()
137
+ {
138
+ if (!$this->login_ok)
139
+ {
140
+ $this->debugRequest();
141
+ $this->stopPlugin();
142
+ return false;
143
+ }
144
+ else $url=$this->login_ok;
145
+ $res=$this->get($url,true);
146
+
147
+ $form_action=$this->getElementString($res,'action="','"');
148
+ $post_elements=$this->getHiddenElements($res);$post_elements['MSignal_UA-*U-1']='Upload/Download';
149
+ $res=$this->post($form_action,$post_elements,true);
150
+ if ($this->checkResponse('contacts_page',$res))
151
+ $this->updateDebugBuffer('contacts_page',"{$form_action}",'POST',true,$post_elements);
152
+ else
153
+ {
154
+ $this->updateDebugBuffer('contacts_page',"{$form_action}",'POST',false,$post_elements);
155
+ $this->debugRequest();
156
+ $this->stopPlugin();
157
+ return false;
158
+ }
159
+
160
+ $post_elements=array();
161
+ $form_action=$this->getElementString($res,'action="','"');
162
+ $post_elements['nojs']=0;
163
+ $post_elements['_charset_']='ISO-8859-1';
164
+ $post_elements['MLS']='UA-*';
165
+ $post_elements['MSS']='!AD-*';
166
+ $post_elements['SAD-AL-DR']=0;
167
+ $post_elements['FUA-DownloadFormat']='OL';
168
+ $post_elements['FUA-Group']=0;
169
+ $post_elements['MSignal_UA-Download*']='';
170
+ $res=$this->post($form_action,$post_elements);
171
+ if ($this->checkResponse('contacts_file',$res))
172
+ $this->updateDebugBuffer('contacts_file',"{$form_action}",'POST',true,$post_elements);
173
+ else
174
+ {
175
+ $this->updateDebugBuffer('contacts_file',"{$form_action}",'POST',false,$post_elements);
176
+ $this->debugRequest();
177
+ $this->stopPlugin();
178
+ return false;
179
+ }
180
+
181
+ $temp=$this->parseCSV($res);
182
+ $contacts=array();$descriptionArray=array();
183
+ foreach ($temp as $values)
184
+ {
185
+ if (!empty($values[34]))
186
+ $contacts[$values[34]]=array('first_name'=>(!empty($values[1])?$values[1]:false),
187
+ 'middle_name'=>false,
188
+ 'last_name'=>(!empty($values[2])?$values[2]:false),
189
+ 'nickname'=>(!empty($values[3])?$values[3]:false),
190
+ 'email_1'=>(!empty($values[34])?$values[34]:false),
191
+ 'email_2'=>(!empty($values[35])?$values[35]:false),
192
+ 'email_3'=>(!empty($values[36])?$values[36]:false),
193
+ 'organization'=>false,
194
+ 'phone_mobile'=>(!empty($values[30])?$values[30]:false),
195
+ 'phone_home'=>(!empty($values[28])?$values[28]:false),
196
+ 'pager'=>(!empty($values[32])?$values[32]:false),
197
+ 'address_home'=>false,
198
+ 'address_city'=>(!empty($values[15])?$values[15]:false),
199
+ 'address_state'=>(!empty($values[16])?$values[16]:false),
200
+ 'address_country'=>(!empty($values[18])?$values[18]:false),
201
+ 'postcode_home'=>(!empty($values[17])?$values[17]:false),
202
+ 'company_work'=>(!empty($values[4])?$values[4]:false),
203
+ 'address_work'=>false,
204
+ 'address_work_city'=>(!empty($values[9])?$values[9]:false),
205
+ 'address_work_country'=>(!empty($values[12])?$values[12]:false),
206
+ 'address_work_state'=>(!empty($values[10])?$values[10]:false),
207
+ 'address_work_postcode'=>(!empty($values[11])?$values[11]:false),
208
+ 'fax_work'=>false,
209
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
210
+ 'website'=>(!empty($values[38])?$values[38]:false),
211
+ 'isq_messenger'=>false,
212
+ 'skype_essenger'=>false,
213
+ 'yahoo_essenger'=>false,
214
+ 'msn_messenger'=>false,
215
+ 'aol_messenger'=>false,
216
+ 'other_messenger'=>false,
217
+ );
218
+ }
219
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
220
+ return $this->returnContacts($contacts);
221
+ }
222
+
223
+ /**
224
+ * Terminate session
225
+ *
226
+ * Terminates the current user's session,
227
+ * debugs the request and reset's the internal
228
+ * debudder.
229
+ *
230
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
231
+ */
232
+ public function logout()
233
+ {
234
+ if (!$this->checkSession()) return false;
235
+ if (file_exists($this->getLogoutPath()))
236
+ {
237
+ $url=file_get_contents($this->getLogoutPath());
238
+ //go to url adress book url in order to make the logout
239
+ $res=$this->get($url,true);
240
+ $form_action=$this->getElementString($res,'action="','"');
241
+ $post_elements=$this->getHiddenElements($res);
242
+ $post_elements['MSignal_AD-LGO*C-1.N-1']='Logout';
243
+
244
+ //get the post elements and make de logout
245
+ $res=$this->post($form_action,$post_elements,true);
246
+ }
247
+ $this->debugRequest();
248
+ $this->resetDebugger();
249
+ $this->stopPlugin();
250
+ return true;
251
+ }
252
+
253
+ }
254
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/fdcareer.plg.php ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from fdcareer
3
+ * You can Write Private Messages using fdcareer system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Fdcareer',
7
+ 'version'=>'1.0.4',
8
+ 'description'=>"Get the contacts from a Fdcareer account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.fdcareer.com/user/login',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * fdcareer Plugin
17
+ *
18
+ * Import Friends from fdcareer
19
+ * You can Write Private Messages using fdcareer system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class fdcareer extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'md5password',
33
+ 'login_post'=>'logout',
34
+ 'get_friends'=>'Send a message',
35
+ 'url_send_message'=>'recipient_id',
36
+ 'send_message'=>'Inbox'
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='fdcareer';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("http://www.fdcareer.com/user/login",true);
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"http://www.brazencareerist.com/",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"http://www.brazencareerist.com/",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+
68
+ $form_action="http://www.fdcareer.com/user/do_login";
69
+ $post_elements=array('email'=>$user,
70
+ 'md5password'=>md5($pass),
71
+ 'timezone_offset'=>-120,
72
+ );
73
+ $res=$this->post($form_action,$post_elements,true);
74
+ if ($this->checkResponse("login_post",$res))
75
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
76
+ else
77
+ {
78
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
79
+ $this->debugRequest();
80
+ $this->stopPlugin();
81
+ return false;
82
+ }
83
+ $url_friends='http://www.fdcareer.com/my/friends';
84
+ $this->login_ok=$url_friends;
85
+ return true;
86
+ }
87
+
88
+ /**
89
+ * Get the current user's contacts
90
+ *
91
+ * Makes all the necesarry requests to import
92
+ * the current user's contacts
93
+ *
94
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
95
+ */
96
+ public function getMyContacts()
97
+ {
98
+ if (!$this->login_ok)
99
+ {
100
+ $this->debugRequest();
101
+ $this->stopPlugin();
102
+ return false;
103
+ }
104
+ else $url=$this->login_ok;
105
+ $res=$this->get($url,true);
106
+ if ($this->checkResponse("get_friends",$res))
107
+ $this->updateDebugBuffer('get_friends',$url,'GET');
108
+ else
109
+ {
110
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
111
+ $this->debugRequest();
112
+ $this->stopPlugin();
113
+ return false;
114
+ }
115
+ $contacts=array();
116
+ $names_array=$this->getElementDOM($res,"//a [@style='margin-bottom:5px;display:block']");
117
+ $href_array=$this->getElementDOM($res,"//a [@title='Send a message']",'href');
118
+ foreach($href_array as $key=>$value)
119
+ if (!empty($value)) $contacts[$value]=$names_array[$key];
120
+ return $contacts;
121
+ }
122
+
123
+ /**
124
+ * Send message to contacts
125
+ *
126
+ * Sends a message to the contacts using
127
+ * the service's inernal messaging system
128
+ *
129
+ * @param string $cookie_file The location of the cookies file for the current session
130
+ * @param string $message The message being sent to your contacts
131
+ * @param array $contacts An array of the contacts that will receive the message
132
+ * @return mixed FALSE on failure.
133
+ */
134
+ public function sendMessage($session_id,$message,$contacts)
135
+ {
136
+ $countMessages=0;
137
+ foreach($contacts as $href=>$name)
138
+ {
139
+ $countMessages++;
140
+ $res=$this->get($href);
141
+ if ($this->checkResponse("url_send_message",$res))
142
+ $this->updateDebugBuffer('url_send_message',$href,'GET');
143
+ else
144
+ {
145
+ $this->updateDebugBuffer('url_send_message',$href,'GET',false);
146
+ $this->debugRequest();
147
+ $this->stopPlugin();
148
+ return false;
149
+ }
150
+
151
+ $form_action="http://www.fdcareer.com/my/inbox/send/0";
152
+ $post_elements['recipient_id']=$this->getElementString($res,"name='recipient_id' id='recipient_id' value='","'");$post_elements['recipients']=$name;$post_elements['subject']=$message['subject'];$post_elements['body']=$message['body'];
153
+ $res=$this->post($form_action,$post_elements,true);
154
+ if ($this->checkResponse("send_message",$res))
155
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
156
+ else
157
+ {
158
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
159
+ $this->debugRequest();
160
+ $this->stopPlugin();
161
+ return false;
162
+ }
163
+ sleep($this->messageDelay);
164
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
165
+ }
166
+
167
+ }
168
+
169
+ /**
170
+ * Terminate session
171
+ *
172
+ * Terminates the current user's session,
173
+ * debugs the request and reset's the internal
174
+ * debudder.
175
+ *
176
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
177
+ */
178
+ public function logout()
179
+ {
180
+ if (!$this->checkSession()) return false;
181
+ $res=$this->get("http://www.fdcareer.com/user/logout");
182
+ $this->debugRequest();
183
+ $this->resetDebugger();
184
+ $this->stopPlugin();
185
+ return true;
186
+ }
187
+ }
188
+
189
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/flickr.plg.php ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Flickr.com
3
+ * You can send private message using Flickr system to your Friends
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Flickr',
7
+ 'version'=>'1.0.6',
8
+ 'description'=>"Get the contacts from a Flickr account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.flickr.com',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Flickr Plugin
17
+ *
18
+ * Imports user's contacts from Flickr and send messages
19
+ * using Flickr's internal system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.2
23
+ */
24
+ class flickr extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'login.yahoo',
33
+ 'login_post'=>'window.location.replace(',
34
+ 'redirect_cookie'=>'magic_cookie',
35
+ 'frinds_page'=>'Who',
36
+ 'send_message_url'=>'magic_cookie',
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='flickr';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("http://www.flickr.com/signin/",true);
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"http://www.flickr.com/signin/",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"http://www.flickr.com/signin/",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+
68
+ $form_action="https://login.yahoo.com/config/login?";
69
+ $post_elements=$this->getHiddenElements($res);$post_elements["save"]="Sign In";$post_elements['login']=$user;$post_elements['passwd']=$pass;
70
+ $res=$this->post($form_action,$post_elements,true);
71
+ if ($this->checkResponse("login_post",$res))
72
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
73
+ else
74
+ {
75
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
76
+ $this->debugRequest();
77
+ $this->stopPlugin();
78
+ return false;
79
+ }
80
+
81
+ $url_redirect=$this->getElementString($res,'window.location.replace("','"');
82
+ $res=$this->get($url_redirect,true);
83
+ if ($this->checkResponse("redirect_cookie",$res))
84
+ $this->updateDebugBuffer('redirect_cookie',$url_redirect,'GET');
85
+ else
86
+ {
87
+ $this->updateDebugBuffer('redirect_cookie',$url_redirect,'GET',false);
88
+ $this->debugRequest();
89
+ $this->stopPlugin();
90
+ return false;
91
+ }
92
+
93
+ $url_friends="http://www.flickr.com/people/".$this->getElementString("$res",'<span><a href="/photos/','"')."contacts/?see=friends";
94
+
95
+ $this->login_ok=$url_friends;
96
+ return true;
97
+ }
98
+
99
+ /**
100
+ * Get the current user's contacts
101
+ *
102
+ * Makes all the necesarry requests to import
103
+ * the current user's contacts
104
+ *
105
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
106
+ */
107
+ public function getMyContacts()
108
+ {
109
+ if (!$this->login_ok)
110
+ {
111
+ $this->debugRequest();
112
+ $this->stopPlugin();
113
+ return false;
114
+ }
115
+ else $url=$this->login_ok;
116
+ $res=$this->get($url);
117
+
118
+ if ($this->checkResponse("frinds_page",$res))
119
+ $this->updateDebugBuffer('frinds_page',$url,'GET');
120
+ else
121
+ {
122
+ $this->updateDebugBuffer('frinds_page',$url,'GET',false);
123
+ $this->debugRequest();
124
+ $this->stopPlugin();
125
+ return false;
126
+ }
127
+
128
+ $contacts=array();
129
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
130
+ $xpath=new DOMXPath($doc);$query="//a[@rel='contact']";$data=$xpath->query($query);
131
+ foreach($data as $node)
132
+ {
133
+ if (strpos($node->getAttribute('title'),'photos')!==false)
134
+ {
135
+ $name=$node->nodeValue;
136
+ $id=str_replace('/','',str_replace('/photos/','',(string)$node->getAttribute('href')));
137
+ if (!empty($name)) $contacts[$id]=$name;
138
+ }
139
+ }
140
+ return $contacts;
141
+ }
142
+
143
+ /**
144
+ * Send message to contacts
145
+ *
146
+ * Sends a message to the contacts using
147
+ * the service's inernal messaging system
148
+ *
149
+ * @param string $session_id The OpenInviter user's session ID
150
+ * @param string $message The message being sent to your contacts
151
+ * @param array $contacts An array of the contacts that will receive the message
152
+ * @return mixed FALSE on failure.
153
+ */
154
+ public function sendMessage($session_id,$message,$contacts)
155
+ {
156
+ $countMessages=0;
157
+ foreach($contacts as $id=>$name)
158
+ {
159
+ $countMessages++;
160
+ $url_send_message="http://www.flickr.com/messages_write.gne?to={$id}";
161
+ $res=$this->get($url_send_message);
162
+ if ($this->checkResponse("send_message_url",$res))
163
+ $this->updateDebugBuffer('send_message_url',$url_send_message,'GET');
164
+ else
165
+ {
166
+ $this->updateDebugBuffer('send_message_url',$url_send_message,'GET',false);
167
+ $this->debugRequest();
168
+ $this->stopPlugin();
169
+ return false;
170
+ }
171
+ $form_action="http://www.flickr.com/messages_write.gne";
172
+ $post_elements=array("magic_cookie"=>$this->getElementString($res,'name="magic_cookie" value="','"'),
173
+ "to"=>$this->getElementString($res,'name="to" value="','"'),
174
+ "to_nsid"=>$this->getElementString($res,'name="to_nsid" value="','"'),
175
+ "reply"=>"",
176
+ "done"=>1,
177
+ "subject"=>$message['subject'],
178
+ "message"=>$message['body']
179
+ );
180
+ $res=$this->post($form_action,$post_elements);
181
+ sleep($this->messageDelay);
182
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
183
+ }
184
+ }
185
+
186
+ /**
187
+ * Terminate session
188
+ *
189
+ * Terminates the current user's session,
190
+ * debugs the request and reset's the internal
191
+ * debudder.
192
+ *
193
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
194
+ */
195
+ public function logout()
196
+ {
197
+ if (!$this->checkSession()) return false;
198
+ $res=$this->get("http://www.flickr.com/");
199
+ $logout_url="http://www.flickr.com/logout.gne?magic_cookie=".$this->getElementString($res,'/logout.gne?magic_cookie=','"');
200
+ $res=$this->get($logout_url);
201
+ $res=$this->get("http://login.yahoo.com/config/login?logout=1&.intl=us&.done=http://us.yahoo.com");
202
+ $this->debugRequest();
203
+ $this->resetDebugger();
204
+ $this->stopPlugin();
205
+ return true;
206
+
207
+ }
208
+ }
209
+
210
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/flingr.plg.php ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Flingr
3
+ * You can Write Private Messages using Flingr system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Flingr',
7
+ 'version'=>'1.0.4',
8
+ 'description'=>"Get the contacts from a Flingr account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.flingr.com/index.php',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Flingr Plugin
17
+ *
18
+ * Import Friends from Flingr
19
+ * You can Write Private Messages using Flingr system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class flingr extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'email',
33
+ 'login_post'=>'logout',
34
+ 'get_friends'=>'friend-actions',
35
+ 'send_message'=>'UserID'
36
+ );
37
+
38
+ /**
39
+ * Login function
40
+ *
41
+ * Makes all the necessary requests to authenticate
42
+ * the current user to the server.
43
+ *
44
+ * @param string $user The current user.
45
+ * @param string $pass The password for the current user.
46
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
47
+ */
48
+ public function login($user,$pass)
49
+ {
50
+ $this->resetDebugger();
51
+ $this->service='flingr';
52
+ $this->service_user=$user;
53
+ $this->service_password=$pass;
54
+ if (!$this->init()) return false;
55
+
56
+ $res=$this->get("http://www.flingr.com/index.php",true);
57
+ if ($this->checkResponse("initial_get",$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.flingr.com/index.php",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.flingr.com/index.php",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+
67
+ $form_action="http://www.flingr.com/login.php";
68
+ $post_elements=array('email'=>$user,
69
+ 'password'=>$pass,
70
+ );
71
+ $res=$this->post($form_action,$post_elements,true);
72
+ if ($this->checkResponse("login_post",$res))
73
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
74
+ else
75
+ {
76
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
77
+ $this->debugRequest();
78
+ $this->stopPlugin();
79
+ return false;
80
+ }
81
+ $url_friends='http://www.flingr.com/friends/action/viewall/UserID/'.$this->getElementString($res,'http://www.flingr.com/friends/action/viewall/UserID/','/').'/';
82
+ $this->login_ok=$url_friends;
83
+ return true;
84
+ }
85
+
86
+ /**
87
+ * Get the current user's contacts
88
+ *
89
+ * Makes all the necesarry requests to import
90
+ * the current user's contacts
91
+ *
92
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
93
+ */
94
+ public function getMyContacts()
95
+ {
96
+ if (!$this->login_ok)
97
+ {
98
+ $this->debugRequest();
99
+ $this->stopPlugin();
100
+ return false;
101
+ }
102
+ else $url=$this->login_ok;
103
+ $res=$this->get($url);
104
+ if ($this->checkResponse("get_friends",$res))
105
+ $this->updateDebugBuffer('get_friends',$url,'GET');
106
+ else
107
+ {
108
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
109
+ $this->debugRequest();
110
+ $this->stopPlugin();
111
+ return false;
112
+ }
113
+
114
+ $contacts=array();
115
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
116
+ $xpath=new DOMXPath($doc);$query="//span[@class='friend-actions']";$data=$xpath->query($query);
117
+ foreach($data as $node)
118
+ {
119
+ $name=trim((string)$node->childNodes->item(0)->nodeValue);
120
+ $id=str_replace('/','',str_replace('http://www.flingr.com/friends/action/remove/UserID/','',(string)$node->childNodes->item(1)->childNodes->item(0)->getAttribute('href')));
121
+ if (!empty($id)) $contacts[$id]=(!empty($name)?$name:false);
122
+ }
123
+ return $contacts;
124
+ }
125
+
126
+ /**
127
+ * Send message to contacts
128
+ *
129
+ * Sends a message to the contacts using
130
+ * the service's inernal messaging system
131
+ *
132
+ * @param string $cookie_file The location of the cookies file for the current session
133
+ * @param string $message The message being sent to your contacts
134
+ * @param array $contacts An array of the contacts that will receive the message
135
+ * @return mixed FALSE on failure.
136
+ */
137
+ public function sendMessage($session_id,$message,$contacts)
138
+ {
139
+ $countMessages=0;
140
+ foreach($contacts as $id=>$name)
141
+ {
142
+ $countMessages++;
143
+ $form_action="http://www.flingr.com/messages/action/send/UserID/{$id}/";
144
+ $post_elements=array('Title'=>$message['subject'],
145
+ 'editor'=>$message['body'],
146
+ 'submit'=>'Send Message'
147
+ );
148
+ $res=$this->post($form_action,$post_elements);
149
+ if ($this->checkResponse("send_message",$res))
150
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
151
+ else
152
+ {
153
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
154
+ $this->debugRequest();
155
+ $this->stopPlugin();
156
+ return false;
157
+ }
158
+ sleep($this->messageDelay);
159
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
160
+ }
161
+
162
+ }
163
+
164
+ /**
165
+ * Terminate session
166
+ *
167
+ * Terminates the current user's session,
168
+ * debugs the request and reset's the internal
169
+ * debudder.
170
+ *
171
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
172
+ */
173
+ public function logout()
174
+ {
175
+ if (!$this->checkSession()) return false;
176
+ $res=$this->get("http://www.flingr.com/login/action/logout/");
177
+ $this->debugRequest();
178
+ $this->resetDebugger();
179
+ $this->stopPlugin();
180
+ return true;
181
+ }
182
+ }
183
+
184
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/flixster.plg.php ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Flixster
3
+ * You can Post Messages using Flixster system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Flixster',
7
+ 'version'=>'1.0.7',
8
+ 'description'=>"Get the contacts from a Flixster account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.flixster.com/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Flixster Plugin
17
+ *
18
+ * Import user's contacts from Flixster and Post comments
19
+ * using Flixster's internal Posting system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.4
23
+ */
24
+ class flixster extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'userauthAction',
33
+ 'login_post'=>'TalkCommentPopupLink',
34
+ 'get_friends'=>'username',
35
+ 'url_friends'=>'addProfileComment=&friendsUserId',
36
+ 'send_message'=>'comment'
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='flixster';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("http://www.flixster.com/friends");
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"http://www.flixster.com/friends",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"http://www.flixster.com/friends",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+
68
+ $form_action="http://www.flixster.com/userAuth.do";
69
+ $post_elements=array("userauthAction"=>"doLogin",
70
+ "redirectTarget"=>"/friends",
71
+ "userauthEmail"=>$user,
72
+ "userauthPassword"=>$pass,
73
+ "userauthRemember"=>"on",
74
+ "submit"=>"Login to Flixster &gt;"
75
+ );
76
+ $res=$this->post($form_action,$post_elements,true);
77
+ if ($this->checkResponse("login_post",$res))
78
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
79
+ else
80
+ {
81
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
82
+ $this->debugRequest();
83
+ $this->stopPlugin();
84
+ return false;
85
+ }
86
+
87
+ $url_friend=explode("@",$user);
88
+ $url_friends="http://www.flixster.com/user/{$url_friend[0]}/friends";
89
+
90
+ $this->login_ok=$url_friends;
91
+ return true;
92
+ }
93
+
94
+ /**
95
+ * Get the current user's contacts
96
+ *
97
+ * Makes all the necesarry requests to import
98
+ * the current user's contacts
99
+ *
100
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
101
+ */
102
+ public function getMyContacts()
103
+ {
104
+ if (!$this->login_ok)
105
+ {
106
+ $this->debugRequest();
107
+ $this->stopPlugin();
108
+ return false;
109
+ }
110
+ else $url=$this->login_ok;
111
+
112
+ $res=$this->get($url,true);
113
+ if ($this->checkResponse("get_friends",$res))
114
+ $this->updateDebugBuffer('get_friends',$url,'GET');
115
+ else
116
+ {
117
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
118
+ $this->debugRequest();
119
+ $this->stopPlugin();
120
+ return false;
121
+ }
122
+
123
+ $contacts=array();
124
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
125
+ $xpath=new DOMXPath($doc);$query="//a[@class='username']";$data=$xpath->query($query);
126
+ foreach($data as $node)
127
+ {
128
+ $name=str_replace("...","",$node->nodeValue);
129
+ $id=$node->getAttribute('href');
130
+ if (!empty($name)) $contacts[$id]=!empty($name)?$name:false;
131
+ }
132
+ return $contacts;
133
+ }
134
+
135
+ /**
136
+ * Send message to contacts
137
+ *
138
+ * Sends a message to the contacts using
139
+ * the service's inernal messaging system
140
+ *
141
+ * @param string $cookie_file The location of the cookies file for the current session
142
+ * @param string $message The message being sent to your contacts
143
+ * @param array $contacts An array of the contacts that will receive the message
144
+ * @return mixed FALSE on failure.
145
+ */
146
+ public function sendMessage($session_id,$message,$contacts)
147
+ {
148
+ $countMessages=0;
149
+ foreach($contacts as $id=>$name)
150
+ {
151
+ $countMessages++;
152
+ $res=$this->get("http://www.flixster.com{$id}");
153
+ if ($this->checkResponse("url_friends",$res))
154
+ $this->updateDebugBuffer('url_friends',"http://www.flixster.com{$id}",'GET');
155
+ else
156
+ {
157
+ $this->updateDebugBuffer('url_friends',"http://www.flixster.com{$id}",'GET',false);
158
+ $this->debugRequest();
159
+ $this->stopPlugin();
160
+ return false;
161
+ }
162
+ $user_id=$this->getElementString($res,'addProfileComment=&friendsUserId=','"');
163
+ $form_action="http://www.flixster.com/talk.do ";
164
+ $post_elements=array(
165
+ 'talkAction'=>'addProfileComment',
166
+ 'talkAnchor'=>'comments',
167
+ 'friendsUserId'=>$user_id,
168
+ 'comment'=>$message['body'],
169
+ 'submit'=>'Send'
170
+ );
171
+ $res=$this->post($form_action,$post_elements,true);
172
+ if ($this->checkResponse("send_message",$res))
173
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
174
+ else
175
+ {
176
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
177
+ $this->debugRequest();
178
+ $this->stopPlugin();
179
+ return false;
180
+ }
181
+ sleep($this->messageDelay);
182
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
183
+ }
184
+
185
+ }
186
+
187
+ /**
188
+ * Terminate session
189
+ *
190
+ * Terminates the current user's session,
191
+ * debugs the request and reset's the internal
192
+ * debudder.
193
+ *
194
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
195
+ */
196
+ public function logout()
197
+ {
198
+ if (!$this->checkSession()) return false;
199
+ $res=$this->get("http://www.flixster.com/userAuth.do?userauthAction=doLogout");
200
+ $this->debugRequest();
201
+ $this->resetDebugger();
202
+ $this->stopPlugin();
203
+ return true;
204
+ }
205
+ }
206
+
207
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/fm5.plg.php ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'5Fm',
4
+ 'version'=>'1.0.3',
5
+ 'description'=>"Get the contacts from a 5fm.za.com account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.5fm.za.com/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * 5FM.za.com Plugin
15
+ *
16
+ * Imports user's contacts from 5FM.za.com AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class fm5 extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'secretkey',
30
+ 'login_post'=>'webmail',
31
+ 'url_export'=>'export',
32
+ 'contacts_file'=>','
33
+ );
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user,$pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='5fm';
49
+ $this->service_user=$user;
50
+ $this->service_password=$pass;
51
+ if (!$this->init()) return false;
52
+
53
+ $res=$this->get("http://www.5fm.za.com/");
54
+ if ($this->checkResponse("initial_get",$res))
55
+ $this->updateDebugBuffer('initial_get',"http://www.5fm.za.com/",'GET');
56
+ else
57
+ {
58
+ $this->updateDebugBuffer('initial_get',"http://www.5fm.za.com/",'GET',false);
59
+ $this->debugRequest();
60
+ $this->stopPlugin();
61
+ return false;
62
+ }
63
+
64
+ $form_action="http://webmail.5fm.za.com/src/redirect.php";
65
+ $post_elements=array('login_domain'=>'5fm.za.com',
66
+ 'login_username'=>$user,
67
+ 'secretkey'=>$pass,
68
+ 'login'=>'login'
69
+ );
70
+ $res=$this->post($form_action,$post_elements,false,true,false,array(),false,false);
71
+ if ($this->checkResponse('login_post',$res))
72
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
73
+ else
74
+ {
75
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
76
+ $this->debugRequest();
77
+ $this->stopPlugin();
78
+ return false;
79
+ }
80
+ $url_adressbook='http://webmail.5fm.za.com/src/addressbook.php';
81
+ $this->login_ok=$url_adressbook;
82
+ return true;
83
+ }
84
+
85
+ /**
86
+ * Get the current user's contacts
87
+ *
88
+ * Makes all the necesarry requests to import
89
+ * the current user's contacts
90
+ *
91
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
92
+ */
93
+ public function getMyContacts()
94
+ {
95
+ if (!$this->login_ok)
96
+ {
97
+ $this->debugRequest();
98
+ $this->stopPlugin();
99
+ return false;
100
+ }
101
+ else $url=$this->login_ok;
102
+ $res=$this->get($url);
103
+ if ($this->checkResponse("url_export",$res))
104
+ $this->updateDebugBuffer('url_export',$url,'GET');
105
+ else
106
+ {
107
+ $this->updateDebugBuffer('url_export',$url,'GET',false);
108
+ $this->debugRequest();
109
+ $this->stopPlugin();
110
+ return false;
111
+ }
112
+
113
+ $form_action='http://webmail.5fm.za.com/plugins/abook_import_export/address_book_export.php';
114
+ $res=$this->post($form_action,array());
115
+ if ($this->checkResponse("contacts_file",$res))
116
+ $this->updateDebugBuffer('contacts_file',$form_action,'POST',true,array());
117
+ else
118
+ {
119
+ $this->updateDebugBuffer('contacts_file',$form_action,'POST',false,array());
120
+ $this->debugRequest();
121
+ $this->stopPlugin();
122
+ return false;
123
+ }
124
+ $temp=$this->parseCSV($res);
125
+ $contacts=array();
126
+ foreach ($temp as $values)
127
+ {
128
+ if (!empty($values[4]))
129
+ $contacts[$values[4]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
130
+ 'middle_name'=>(!empty($values[2])?$values[2]:false),
131
+ 'last_name'=>(!empty($values[1])?$values[1]:false),
132
+ 'nickname'=>false,
133
+ 'email_1'=>(!empty($values[4])?$values[4]:false),
134
+ 'email_2'=>false,
135
+ 'email_3'=>false,
136
+ 'organization'=>false,
137
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
138
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
139
+ 'pager'=>false,
140
+ 'address_home'=>false,
141
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
142
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
143
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
144
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
145
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
146
+ 'address_work'=>false,
147
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
148
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
149
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
150
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
151
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
152
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
153
+ 'website'=>(!empty($values[12])?$values[12]:false),
154
+ 'isq_messenger'=>false,
155
+ 'skype_essenger'=>false,
156
+ 'yahoo_essenger'=>false,
157
+ 'msn_messenger'=>false,
158
+ 'aol_messenger'=>false,
159
+ 'other_messenger'=>false,
160
+ );
161
+ }
162
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
163
+ return $this->returnContacts($contacts);
164
+ }
165
+
166
+ /**
167
+ * Terminate session
168
+ *
169
+ * Terminates the current user's session,
170
+ * debugs the request and reset's the internal
171
+ * debudder.
172
+ *
173
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
174
+ */
175
+ public function logout()
176
+ {
177
+ if (!$this->checkSession()) return false;
178
+ $res=$this->get('http://webmail.5fm.za.com/src/signout.php',true);
179
+ $this->debugRequest();
180
+ $this->resetDebugger();
181
+ $this->stopPlugin();
182
+ return true;
183
+ }
184
+
185
+ }
186
+
187
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/freemail.plg.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Freemail',
4
+ 'version'=>'1.0.5',
5
+ 'description'=>"Get the contacts from a freemail.hu account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://freemail.hu/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(freemail.hu)/i'),
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Freemail.hu Plugin
15
+ *
16
+ * Imports user's contacts from Freemail.hu AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class freemail extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'userwithoutdomain',
30
+ 'login_post'=>'auth=ok',
31
+ 'url_adressbook'=>'first',
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ * fr
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user,$pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='freemail';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("http://freemail.hu/levelezes/login.fm");
53
+ if ($this->checkResponse("initial_get",$res))
54
+ $this->updateDebugBuffer('initial_get',"http://freemail.hu/levelezes/login.fm",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"http://freemail.hu/levelezes/login.fm",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+
63
+ $userStriped=str_replace("@freemail.hu","",$user);
64
+ $form_action="http://belepes.t-online.hu/auth.html";
65
+ $post_elements=array('.formId'=>'commands.PlusAuth',
66
+ 'backurl'=>'http://freemail.hu/levelezes/auth.fm?cmd=checkuser&page=levelezes',
67
+ 'cmd'=>'plusauth',
68
+ 'remoteform'=>1,
69
+ 'user'=>$user,
70
+ 'userwithoutdomain'=>$userStriped,
71
+ 'pass'=>$pass,
72
+ );
73
+ $res=$this->post($form_action,$post_elements,true);
74
+ if ($this->checkResponse('login_post',$res))
75
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
76
+ else
77
+ {
78
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
79
+ $this->debugRequest();
80
+ $this->stopPlugin();
81
+ return false;
82
+ }
83
+ $url_redirect=$this->getElementString($res,'url=','"');$url_adressbook=str_replace(array('levelezes/auth.fm?cmd=checkuser&page=levelezes&status=ok&auth=ok&','tid','email','freul_Id.hu'),array('cc/fsAddressBook.do?','ul_Tid','ul_Id','freemail.hu'),$url_redirect);
84
+ $this->login_ok=$url_adressbook;
85
+ return true;
86
+ }
87
+
88
+ /**
89
+ * Get the current user's contacts
90
+ *
91
+ * Makes all the necesarry requests to import
92
+ * the current user's contacts
93
+ *
94
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
95
+ */
96
+ public function getMyContacts()
97
+ {
98
+ if (!$this->login_ok)
99
+ {
100
+ $this->debugRequest();
101
+ $this->stopPlugin();
102
+ return false;
103
+ }
104
+ else $url=$this->login_ok;
105
+ $res=$this->get($url,true);
106
+ if ($this->checkResponse("url_adressbook",$res))
107
+ $this->updateDebugBuffer('url_adressbook',$url,'GET');
108
+ else
109
+ {
110
+ $this->updateDebugBuffer('url_adressbook',$url,'GET',false);
111
+ $this->debugRequest();
112
+ $this->stopPlugin();
113
+ return false;
114
+ }
115
+ $contacts=array();
116
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
117
+ $xpath=new DOMXPath($doc);$query="//tr[@class='data']";$data=$xpath->query($query);
118
+ foreach($data as $node)
119
+ {
120
+ $names=trim(preg_replace('/[^(\x20-\x7F)]*/','',utf8_decode((string)$node->childNodes->item(2)->nodeValue)));
121
+ $emails=trim(preg_replace('/[^(\x20-\x7F)]*/','',(utf8_decode((string)$node->childNodes->item(4)->nodeValue))));
122
+ if (!empty($emails)) $contacts[$emails]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$emails);
123
+ }
124
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
125
+ return $this->returnContacts($contacts);
126
+ }
127
+
128
+ /**
129
+ * Terminate session
130
+ *
131
+ * Terminates the current user's session,
132
+ * debugs the request and reset's the internal
133
+ * debudder.
134
+ *
135
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
136
+ */
137
+ public function logout()
138
+ {
139
+ if (!$this->checkSession()) return false;
140
+ $res=$this->get('http://freemail.hu/levelezes/main.fm?page=logout',true);
141
+ $this->debugRequest();
142
+ $this->resetDebugger();
143
+ $this->stopPlugin();
144
+ return true;
145
+ }
146
+
147
+ }
148
+
149
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/friendfeed.plg.php ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Friendfeed
3
+ * You can POST message to your Friends
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Friendfeed',
7
+ 'version'=>'1.0.5',
8
+ 'description'=>"Get the contacts from a Friendfeed account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'https://friendfeed.com/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * FaceBook Plugin
17
+ *
18
+ * Imports user's contacts from FaceBook and sends
19
+ * messages using FaceBook's internal system.
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class friendfeed extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'email',
33
+ 'login_post'=>'Photos',
34
+ 'friends'=>'class="picture medium"',
35
+ 'url_home'=>'share',
36
+ 'send_message'=>'sid='
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='friendfeed';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("https://friendfeed.com/account/login",true);
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"https://friendfeed.com/account/login",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"https://friendfeed.com/account/login",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+
68
+ $form_action="https://friendfeed.com/account/login";
69
+ $post_elements=$this->getHiddenElements($res);
70
+ $post_elements["email"]=$user;$post_elements["password"]=$pass;
71
+ $res=$this->post($form_action,$post_elements,true);
72
+ if ($this->checkResponse("login_post",$res))
73
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
74
+ else
75
+ {
76
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
77
+ $this->debugRequest();
78
+ $this->stopPlugin();
79
+ return false;
80
+ }
81
+
82
+ $url_friends="https://friendfeed.com/friends";
83
+ $this->login_ok=$url_friends;
84
+ return true;
85
+ }
86
+
87
+ /**
88
+ * Get the current user's contacts
89
+ *
90
+ * Makes all the necesarry requests to import
91
+ * the current user's contacts
92
+ *
93
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
94
+ */
95
+ public function getMyContacts()
96
+ {
97
+ if (!$this->login_ok)
98
+ {
99
+ $this->debugRequest();
100
+ $this->stopPlugin();
101
+ return false;
102
+ }
103
+ else $url=$this->login_ok;
104
+ $res=$this->get($url,true);
105
+ if ($this->checkResponse("friends",$res))
106
+ $this->updateDebugBuffer('friends',$url,'GET');
107
+ else
108
+ {
109
+ $this->updateDebugBuffer('friends',$url,'GET',false);
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+
115
+ $contacts=array();
116
+ $contacts=$this->getElementDOM($res,"//img[@class='picture large']",'alt');
117
+ return $contacts;
118
+ }
119
+
120
+ /**
121
+ * Send message to contacts
122
+ *
123
+ * Sends a message to the contacts using
124
+ * the service's inernal messaging system
125
+ *
126
+ * @param string $session_id The OpenInviter user's session ID
127
+ * @param string $message The message being sent to your contacts
128
+ * @param array $contacts An array of the contacts that will receive the message
129
+ * @return mixed FALSE on failure.
130
+ */
131
+ public function sendMessage($session_id,$message,$contacts)
132
+ {
133
+ $countMessages=0;
134
+ foreach($contacts as $name)
135
+ {
136
+ $countMessages++;
137
+ $res=$this->get("http://friendfeed.com/filter/direct?dm={$name}",true);
138
+ if ($this->checkResponse('url_home',$res))
139
+ $this->updateDebugBuffer('url_home',"http://friendfeed.com/",'GET');
140
+ else
141
+ {
142
+ $this->updateDebugBuffer('url_home',"http://friendfeed.com/",'GET',false);
143
+ $this->debugRequest();
144
+ $this->stopPlugin();
145
+ return false;
146
+ }
147
+
148
+ $form_action="http://friendfeed.com/a/share";
149
+ $post_elements=array('streams'=>$name,
150
+ 'direct_view'=>1,
151
+ 'title'=>$message['body'],
152
+ 'at'=>$this->getElementString($res,'name="at" value="','"'),
153
+ 'maybetweet'=>0,
154
+ '_nano'=>1
155
+ );
156
+ $res=$this->post($form_action,$post_elements,true);
157
+ if ($this->checkResponse("send_message",$res))
158
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
159
+ else
160
+ {
161
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
162
+ $this->debugRequest();
163
+ $this->stopPlugin();
164
+ return false;
165
+ }
166
+ sleep($this->messageDelay);
167
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
168
+ }
169
+ }
170
+
171
+ /**
172
+ * Terminate session
173
+ *
174
+ * Terminates the current user's session,
175
+ * debugs the request and reset's the internal
176
+ * debudder.
177
+ *
178
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
179
+ */
180
+ public function logout()
181
+ {
182
+ if (!$this->checkSession()) return false;
183
+ $res=$this->get("http://friendfeed.com/account/logout",true);
184
+ $this->debugRequest();
185
+ $this->resetDebugger();
186
+ $this->stopPlugin();
187
+ return true;
188
+ }
189
+ }
190
+
191
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/friendster.plg.php ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Friendster.com
3
+ * You can send private message using Friendster system to your Friends
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Friendster',
7
+ 'version'=>'1.1.0',
8
+ 'description'=>"Get the contacts from a Friendster account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.friendster.com',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Friendster Plugin
17
+ *
18
+ * Import user's contacts from Friendster and send messages
19
+ * using Friendster's internal messaging system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.8
23
+ */
24
+ class friendster extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'_submitted',
33
+ 'login_post'=>'pageViewerID',
34
+ 'contacts'=>'thumbnaildelete',
35
+ 'message_compose'=>'msg_type',
36
+ 'message_send'=>'noliststyle noindent'
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='friendster';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("http://www.friendster.com/");
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"http://www.friendster.com/",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"http://www.friendster.com/",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+
68
+ $form_action="http://www.friendster.com/login.php";
69
+ $post_elements=array('tzoffset'=>1,
70
+ 'next'=>'/',
71
+ '_submitted'=>1,
72
+ 'email'=>$user,
73
+ 'password'=>$pass
74
+ );
75
+ $res=$this->post($form_action,$post_elements,true);
76
+ if ($this->checkResponse("login_post",$res))
77
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
78
+ else
79
+ {
80
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
81
+ $this->debugRequest();
82
+ $this->stopPlugin();
83
+ return false;
84
+ }
85
+
86
+ $url_friends="http://www.friendster.com/friends.php";
87
+ $this->login_ok=$url_friends;
88
+ return true;
89
+ }
90
+
91
+ /**
92
+ * Get the current user's contacts
93
+ *
94
+ * Makes all the necesarry requests to import
95
+ * the current user's contacts
96
+ *
97
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
98
+ */
99
+ public function getMyContacts()
100
+ {
101
+ if (!$this->login_ok)
102
+ {
103
+ $this->debugRequest();
104
+ $this->stopPlugin();
105
+ return false;
106
+ }
107
+ else $url=$this->login_ok;
108
+
109
+ $res=$this->get($url,true);
110
+ $contacts=array();
111
+ $page_next=0;
112
+ $number_of_friends_array=explode("of ",$this->getElementString($res,'class="paginglinksmodule">','<'));
113
+ if (!empty($number_of_friends_array[1])) $total_friends=$number_of_friends_array[1];
114
+ else $total_friends=0;
115
+ do
116
+ {
117
+ $page_next++;
118
+
119
+ //go to url friends
120
+ if ($this->checkResponse('contacts',$res))
121
+ $this->updateDebugBuffer('contacts',$url,'GET');
122
+ else
123
+ {
124
+ $this->updateDebugBuffer('contacts',$url,'GET',false);
125
+ $this->debugRequest();
126
+ $this->stopPlugin();
127
+ return false;
128
+ }
129
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
130
+ $xpath=new DOMXPath($doc);$query="//span[@class='strong']";$data=$xpath->query($query);
131
+ foreach ($data as $node)
132
+ $contacts[str_replace("http://profiles.friendster.com/","",(string)$node->firstChild->getAttribute('href'))]=(string)$node->firstChild->nodeValue;
133
+ $url_next="{$url}?page={$page_next}";
134
+ $res=$this->get($url_next,true);
135
+ }
136
+ while ($total_friends>count($contacts)+1);
137
+ return $contacts;
138
+ }
139
+
140
+ /**
141
+ * Send message to contacts
142
+ *
143
+ * Sends a message to the contacts using
144
+ * the service's inernal messaging system
145
+ *
146
+ * @param string $cookie_file The location of the cookies file for the current session
147
+ * @param string $message The message being sent to your contacts
148
+ * @param array $contacts An array of the contacts that will receive the message
149
+ * @return mixed FALSE on failure.
150
+ */
151
+ public function sendMessage($session_id,$message,$contacts)
152
+ {
153
+ $countMessages=0;
154
+ foreach ($contacts as $id=>$name)
155
+ {
156
+ $countMessages++;
157
+ $res=$this->get("http://www.friendster.com/sendmessage.php?uid={$id}",true);
158
+ if ($this->checkResponse('message_compose',$res))
159
+ $this->updateDebugBuffer('message_compose',"http://www.friendster.com/sendmessage.php?uid={$id}",'GET');
160
+ else
161
+ {
162
+ $this->updateDebugBuffer('message_compose',"http://www.friendster.com/sendmessage.php?uid={$id}",'GET',false);
163
+ $this->debugRequest();
164
+ $this->stopPlugin();
165
+ return false;
166
+ }
167
+
168
+ $form_action="http://www.friendster.com/sendmessage.php";
169
+ $post_elements=$this->getHiddenElements($res);
170
+ $post_elements['message']=$message['body'];
171
+ $post_elements['subject']=$message['subject'];
172
+ $res=$this->post($form_action,$post_elements,true);
173
+ if ($this->checkResponse('message_send',$res))
174
+ $this->updateDebugBuffer('message_send',"{$form_action}",'POST',true,$post_elements);
175
+ else
176
+ {
177
+ $this->updateDebugBuffer('message_send',"{$form_action}",'POST',false,$post_elements);
178
+ $this->debugRequest();
179
+ $this->stopPlugin();
180
+ return false;
181
+ }
182
+ sleep($this->messageDelay);
183
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
184
+ }
185
+ }
186
+
187
+ /**
188
+ * Terminate session
189
+ *
190
+ * Terminates the current user's session,
191
+ * debugs the request and reset's the internal
192
+ * debudder.
193
+ *
194
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
195
+ */
196
+ public function logout()
197
+ {
198
+ if (!$this->checkSession()) return false;
199
+ $res=$this->get("http://www.friendster.com/logout.php",true);
200
+ $this->debugRequest();
201
+ $this->resetDebugger();
202
+ $this->stopPlugin();
203
+ return true;
204
+ }
205
+ }
206
+
207
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/gawab.plg.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Gawab',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Gawab account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.gawab.com/default.php',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(gawab.com)/i'),
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * Gawab Plugin
15
+ *
16
+ * Imports user's contacts from Gawab's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class gawab extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'service',
30
+ 'post_login'=>'&_host',
31
+ 'file_contacts'=>'Name',
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user,$pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='gawab';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("http://www.gawab.com/default.php",true);
53
+ if ($this->checkResponse('initial_get',$res))
54
+ $this->updateDebugBuffer('initial_get',"http://www.gawab.com/default.php",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"http://www.gawab.com/default.php",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+ $login_array=explode("@",$user);
63
+ $form_action="http://mail.gawab.com/login";
64
+ $post_elements=array('service'=>'webmail',
65
+ 'username'=>$login_array[0],
66
+ 'domain'=>$login_array[1],
67
+ 'password'=>$pass
68
+ );
69
+ $res=$this->post($form_action,$post_elements,true);
70
+ if ($this->checkResponse('post_login',$res))
71
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',true,$post_elements);
72
+ else
73
+ {
74
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',false,$post_elements);
75
+ $this->debugRequest();
76
+ $this->stopPlugin();
77
+ return false;
78
+ }
79
+ $host=$this->getElementString($res,'&_host=',"'");
80
+ $url_file_contacts="http://mail.gawab.com/{$host}/gwebmail?_module=contact&_action=export&format=outlook&_address=dbautu@gawab.com";
81
+ $this->login_ok=$url_file_contacts;
82
+ return true;
83
+ }
84
+
85
+ /**
86
+ * Get the current user's contacts
87
+ *
88
+ * Makes all the necesarry requests to import
89
+ * the current user's contacts
90
+ *
91
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
92
+ */
93
+ public function getMyContacts()
94
+ {
95
+ if (!$this->login_ok)
96
+ {
97
+ $this->debugRequest();
98
+ $this->stopPlugin();
99
+ return false;
100
+ }
101
+ else $url=$this->login_ok;
102
+ $res=$this->get($url);
103
+ if ($this->checkResponse('file_contacts',$res))
104
+ $this->updateDebugBuffer('file_contacts',$url,'GET');
105
+ else
106
+ {
107
+ $this->updateDebugBuffer('file_contacts',$url,'GET',false);
108
+ $this->debugRequest();
109
+ $this->stopPlugin();
110
+ return false;
111
+ }
112
+
113
+
114
+ $temp=$this->parseCSV($res);
115
+ $contacts=array();
116
+ foreach ($temp as $values)
117
+ {
118
+ if (!empty($values[1]))
119
+ $contacts[$values[1]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
120
+ 'middle_name'=>false,
121
+ 'last_name'=>false,
122
+ 'nickname'=>false,
123
+ 'email_1'=>(!empty($values[1])?$values[1]:false),
124
+ 'email_2'=>(!empty($values[2])?$values[2]:false),
125
+ 'email_3'=>(!empty($values[3])?$values[3]:false),
126
+ 'organization'=>false,
127
+ 'phone_mobile'=>(!empty($values[5])?$values[5]:false),
128
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
129
+ 'pager'=>(!empty($values[6])?$values[6]:false),
130
+ 'address_home'=>(!empty($values[12])?$values[12]:false),
131
+ 'address_city'=>false,
132
+ 'address_state'=>false,
133
+ 'address_country'=>false,
134
+ 'postcode_home'=>false,
135
+ 'company_work'=>(!empty($values[7])?$values[7]:false),
136
+ 'address_work'=>(!empty($values[16])?$values[16]:false),
137
+ 'address_work_city'=>false,
138
+ 'address_work_country'=>false,
139
+ 'address_work_state'=>false,
140
+ 'address_work_postcode'=>false,
141
+ 'fax_work'=>(!empty($values[15])?$values[15]:false),
142
+ 'phone_work'=>(!empty($values[13])?$values[13]:false),
143
+ 'website'=>(!empty($values[12])?$values[12]:false),
144
+ 'isq_messenger'=>false,
145
+ 'skype_essenger'=>false,
146
+ 'yahoo_essenger'=>false,
147
+ 'msn_messenger'=>false,
148
+ 'aol_messenger'=>false,
149
+ 'other_messenger'=>false,
150
+ );
151
+ }
152
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
153
+ return $this->returnContacts($contacts);
154
+
155
+ }
156
+
157
+ /**
158
+ * Terminate session
159
+ *
160
+ * Terminates the current user's session,
161
+ * debugs the request and reset's the internal
162
+ * debudder.
163
+ *
164
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
165
+ */
166
+ public function logout()
167
+ {
168
+ if (!$this->checkSession()) return false;
169
+ $res=$this->get("http://www.gawab.com/",true);
170
+ $this->debugRequest();
171
+ $this->resetDebugger();
172
+ $this->stopPlugin();
173
+ return true;
174
+ }
175
+
176
+ }
177
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/gmail.plg.php ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*This plugin import Gmail contacts
3
+ *You can send normal email
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'GMail',
7
+ 'version'=>'1.4.8',
8
+ 'description'=>"Get the contacts from a GMail account",
9
+ 'base_version'=>'1.6.3',
10
+ 'type'=>'email',
11
+ 'check_url'=>'http://google.com',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ 'detected_domains'=>array('/(gmail.com)/i','/(googlemail.com)/i'),
15
+ 'imported_details'=>array('first_name','email_1','email_2','email_3','organization','phone_mobile','phone_home','fax','pager','address_home','address_work'),
16
+ );
17
+ /**
18
+ * GMail Plugin
19
+ *
20
+ * Imports user's contacts from GMail's AddressBook
21
+ *
22
+ * @author OpenInviter
23
+ * @version 1.4.1
24
+ */
25
+ class gmail extends openinviter_base
26
+ {
27
+ private $login_ok=false;
28
+ public $showContacts=true;
29
+ public $internalError=false;
30
+
31
+ public $debug_array=array(
32
+ 'login_post'=>'Auth=',
33
+ 'contact_xml'=>'xml'
34
+ );
35
+
36
+ /**
37
+ * Login function
38
+ *
39
+ * Makes all the necessary requests to authenticate
40
+ * the current user to the server.
41
+ *
42
+ * @param string $user The current user.
43
+ * @param string $pass The password for the current user.
44
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
45
+ */
46
+ public function login($user,$pass)
47
+ {
48
+ $this->resetDebugger();
49
+ $this->service='gmail';
50
+ $this->service_user=$user;
51
+ $this->service_password=$pass;
52
+ if (!$this->init()) return false;
53
+
54
+ $post_elements=array('accountType'=>'HOSTED_OR_GOOGLE','Email'=>$user,'Passwd'=>$pass,'service'=>'cp','source'=>'OpenInviter-OpenInviter-'.$this->base_version);
55
+ $res=$this->post("https://www.google.com/accounts/ClientLogin",$post_elements,true);
56
+ if ($this->checkResponse("login_post",$res))
57
+ $this->updateDebugBuffer('login_post',"https://www.google.com/accounts/ClientLogin",'POST',true,$post_elements);
58
+ else
59
+ {
60
+ $this->updateDebugBuffer('login_post',"https://www.google.com/accounts/ClientLogin",'POST',false,$post_elements);
61
+ $this->debugRequest();
62
+ $this->stopPlugin();
63
+ return false;
64
+ }
65
+
66
+ $auth=substr($res,strpos($res,'Auth=')+strlen('Auth='));
67
+
68
+ $this->login_ok=$auth;
69
+ return true;
70
+ }
71
+
72
+ /**
73
+ * Get the current user's contacts
74
+ *
75
+ * Makes all the necesarry requests to import
76
+ * the current user's contacts
77
+ *
78
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
79
+ */
80
+ public function getMyContacts()
81
+ {
82
+ if ($this->login_ok===false)
83
+ {
84
+ $this->debugRequest();
85
+ $this->stopPlugin();
86
+ return false;
87
+ }
88
+ else $auth=$this->login_ok;
89
+ $res=$this->get("http://www.google.com/m8/feeds/contacts/default/full?max-results=10000",true,false,true,false,array("Authorization"=>"GoogleLogin auth={$auth}"));
90
+ if ($this->checkResponse("contact_xml",$res))
91
+ $this->updateDebugBuffer('contact_xml','http://www.google.com/m8/feeds/contacts/default/full?max-results=10000','GET');
92
+ else
93
+ {
94
+ $this->updateDebugBuffer('contact_xml','http://www.google.com/m8/feeds/contacts/default/full?max-results=10000','GET',false);
95
+ $this->debugRequest();
96
+ $this->stopPlugin();
97
+ return false;
98
+ }
99
+
100
+ $contacts=array();
101
+ $doc=new DOMDocument();
102
+ libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
103
+ $xpath=new DOMXPath($doc);$query="//entry";$data=$xpath->query($query);
104
+ foreach ($data as $node)
105
+ {
106
+ $entry_nodes=$node->childNodes;
107
+ $tempArray=array();
108
+ foreach($entry_nodes as $child)
109
+ {
110
+ $domNodesName=$child->nodeName;
111
+ switch($domNodesName)
112
+ {
113
+ case 'title' : { $tempArray['first_name']=mb_convert_encoding($child->nodeValue, 'ISO-8859-15', 'UTF-8'); } break;
114
+ case 'organization': { $tempArray['organization']=$child->nodeValue; } break;
115
+ case 'email' :
116
+ {
117
+ if (strpos($child->getAttribute('rel'),'home')!==false)
118
+ $tempArray['email_1']=$child->getAttribute('address');
119
+ elseif(strpos($child->getAttribute('rel'),'work')!=false)
120
+ $tempArray['email_2']=$child->getAttribute('address');
121
+ elseif(strpos($child->getAttribute('rel'),'other')!==false)
122
+ $tempArray['email_3']=$child->getAttribute('address');
123
+ } break;
124
+ case 'phonenumber' :
125
+ {
126
+ if (strpos($child->getAttribute('rel'),'mobile')!==false)
127
+ $tempArray['phone_mobile']=$child->nodeValue;
128
+ elseif(strpos($child->getAttribute('rel'),'home')!==false)
129
+ $tempArray['phone_home']=$child->nodeValue;
130
+ elseif(strpos($child->getAttribute('rel'),'work_fax')!==false)
131
+ $tempArray['fax_work']=$child->nodeValue;
132
+ elseif(strpos($child->getAttribute('rel'),'pager')!=false)
133
+ $tempArray['pager']=$child->nodeValue;
134
+ } break;
135
+ case 'postaladdress' :
136
+ {
137
+ if (strpos($child->getAttribute('rel'),'home')!==false)
138
+ $tempArray['address_home']=$child->nodeValue;
139
+ elseif(strpos($child->getAttribute('rel'),'work')!==false)
140
+ $tempArray['address_work']=$child->nodeValue;
141
+ } break;
142
+ }
143
+ }
144
+ if (!empty($tempArray['email_1']))$contacts[$tempArray['email_1']]=$tempArray;
145
+ if(!empty($tempArray['email_2'])) $contacts[$tempArray['email_2']]=$tempArray;
146
+ if(!empty($tempArray['email_3'])) $contacts[$tempArray['email_3']]=$tempArray;
147
+ }
148
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
149
+ return $this->returnContacts($contacts);
150
+ }
151
+
152
+ /**
153
+ * Terminate session
154
+ *
155
+ * Terminates the current user's session,
156
+ * debugs the request and reset's the internal
157
+ * debudder.
158
+ *
159
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
160
+ */
161
+ public function logout()
162
+ {
163
+ if (!$this->checkSession()) return false;
164
+ $this->debugRequest();
165
+ $this->resetDebugger();
166
+ $this->stopPlugin();
167
+ return true;
168
+ }
169
+ }
170
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/gmx_net.plg.php ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*This plugin import GMX.net contacts
3
+ *You can send normal email
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'GMX.net',
7
+ 'version'=>'1.1.0',
8
+ 'description'=>"Get the contacts from a GMX.net account",
9
+ 'base_version'=>'1.6.3',
10
+ 'type'=>'email',
11
+ 'check_url'=>'http://www.gmx.net',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>array('/(gmx.de)/i','/(gmx.at)/i','/(gmx.ch)/i','/(gmx.net)/i'),
14
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
15
+ );
16
+ /**
17
+ * GMX.net Plugin
18
+ *
19
+ * Imports user's contacts from GMX.net's AddressBook
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.4
23
+ */
24
+ class gmx_net extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'uinguserid',
33
+ 'login'=>'Adressbuch',
34
+ 'export_file'=>'b_export',
35
+ 'contacts_file'=>'","'
36
+ );
37
+
38
+ /**
39
+ * Login function
40
+ *
41
+ * Makes all the necessary requests to authenticate
42
+ * the current user to the server.
43
+ *
44
+ * @param string $user The current user.
45
+ * @param string $pass The password for the current user.
46
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
47
+ */
48
+ public function login($user,$pass)
49
+ {
50
+ $this->resetDebugger();
51
+ $this->service='gmx_net';
52
+ $this->service_user=$user;
53
+ $this->service_password=$pass;
54
+ if (!$this->init()) return false;
55
+
56
+ $res=$this->get("http://www.gmx.net/",true);
57
+ if ($this->checkResponse("initial_get",$res))
58
+ $this->updateDebugBuffer('file_contacts',"http://www.gmx.net/",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('file_contacts',"http://www.gmx.net/",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+ $form_action="http://service.gmx.net/de/cgi/login";
67
+ $post_elements=array('AREA'=>1,
68
+ 'EXT'=>'redirect',
69
+ 'EXT2'=>'',
70
+ 'uinguserid'=>$this->getElementString($res,'name="uinguserid" value="','"'),
71
+ 'id'=>$user,
72
+ 'p'=>$pass,
73
+ 'dlevel'=>'c',
74
+ 'browsersupported'=>'true',
75
+ 'jsenabled'=>'false'
76
+ );
77
+ $res=$this->post($form_action,$post_elements,true);
78
+ if ($this->checkResponse("login",$res))
79
+ $this->updateDebugBuffer('login',$form_action,'POST',true,$post_elements);
80
+ else
81
+ {
82
+ $this->updateDebugBuffer('login',$form_action,'POST',false,$post_elements);
83
+ $this->debugRequest();
84
+ $this->stopPlugin();
85
+ return false;
86
+ }
87
+ $url_adress=str_replace("site=0","site=importexport","http://service.gmx.net/de/cgi/addrbk.fcgi?CUSTOMERNO=".html_entity_decode($this->getElementString($res,'http://service.gmx.net/de/cgi/addrbk.fcgi?CUSTOMERNO=','"')));
88
+ #echo $url_adress;
89
+ $this->login_ok=$url_adress;
90
+ file_put_contents($this->getLogoutPath(),$url_adress);
91
+ return true;
92
+ }
93
+
94
+ /**
95
+ * Get the current user's contacts
96
+ *
97
+ * Makes all the necesarry requests to import
98
+ * the current user's contacts
99
+ *
100
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
101
+ */
102
+ public function getMyContacts()
103
+ {
104
+ if (!$this->login_ok)
105
+ {
106
+ $this->debugRequest();
107
+ $this->stopPlugin();
108
+ return false;
109
+ }
110
+ else $url=$this->login_ok;
111
+ $res=$this->get($url,true);
112
+ if ($this->checkResponse("export_file",$res))
113
+ $this->updateDebugBuffer('export_file',$url,'GET');
114
+ else
115
+ {
116
+ $this->updateDebugBuffer('export_file',$url,'GET',false);
117
+ $this->debugRequest();
118
+ $this->stopPlugin();
119
+ return false;
120
+ }
121
+ $form_action="http://service.gmx.net/de/cgi/addrbk.fcgi";
122
+ $post_elements=$this->getHiddenElements($res);$post_elements['dataformat']='o2002';$post_elements['language']='english';$post_elements['b_export']='Export starten';
123
+ $res=$this->post($form_action,$post_elements);
124
+
125
+ if ($this->checkResponse("contacts_file",$res)){
126
+ $this->updateDebugBuffer('contacts_file',$form_action,'POST',true,$post_elements);
127
+ }else{
128
+ $this->updateDebugBuffer('contacts_file',$form_action,'POST',false,$post_elements);
129
+ $this->debugRequest();
130
+ $this->stopPlugin();
131
+ return false;
132
+ }
133
+ $temp=$this->parseCSV($res);
134
+ $contacts=array();
135
+
136
+ foreach ($temp as $values)
137
+ {
138
+ if (!empty($values[29]))
139
+ $contacts[$values[29]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
140
+ 'middle_name'=>(!empty($values[2])?$values[2]:false),
141
+ 'last_name'=>(!empty($values[1])?$values[1]:false),
142
+ 'nickname'=>false,
143
+ 'email_1'=>(!empty($values[29])?$values[29]:false),
144
+ 'email_2'=>(!empty($values[30])?$values[30]:false),
145
+ 'email_3'=>(!empty($values[31])?$values[31]:false),
146
+ 'organization'=>false,
147
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
148
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
149
+ 'pager'=>false,
150
+ 'address_home'=>false,
151
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
152
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
153
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
154
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
155
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
156
+ 'address_work'=>false,
157
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
158
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
159
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
160
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
161
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
162
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
163
+ 'website'=>(!empty($values[12])?$values[12]:false),
164
+ 'isq_messenger'=>false,
165
+ 'skype_essenger'=>false,
166
+ 'yahoo_essenger'=>false,
167
+ 'msn_messenger'=>false,
168
+ 'aol_messenger'=>false,
169
+ 'other_messenger'=>false,
170
+ );
171
+ }
172
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
173
+ return $this->returnContacts($contacts);
174
+ }
175
+
176
+ /**
177
+ * Terminate session
178
+ *
179
+ * Terminates the current user's session,
180
+ * debugs the request and reset's the internal
181
+ * debudder.
182
+ *
183
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
184
+ */
185
+ public function logout()
186
+ {
187
+ if (!$this->checkSession()) return false;
188
+ if (file_exists($this->getLogoutPath()))
189
+ {
190
+ $url=file_get_contents($this->getLogoutPath());
191
+ $res=$this->get($url,true);
192
+ $logout_url="https://service.gmx.net/de/cgi/nph-logout?CUSTOMERNO=".$this->getElementString($res,"https://service.gmx.net/de/cgi/nph-logout?CUSTOMERNO=",'"');
193
+ $res=$this->get($logout_url,true);
194
+ }
195
+ $this->debugRequest();
196
+ $this->resetDebugger();
197
+ $this->stopPlugin();
198
+ return true;
199
+ }
200
+
201
+ }
202
+
203
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/graffiti.plg.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Grafitti',
4
+ 'version'=>'1.0.2',
5
+ 'description'=>"Get the contacts from a Graffiti account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.graffiti.net/scripts/common/index.main?signin=1&lang=us',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Bordermail Plugin
15
+ *
16
+ * Imports user's contacts from Bordermail AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class graffiti extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'login',
30
+ 'login_post'=>'frontpage',
31
+ 'url_contacts'=>'input'
32
+
33
+ );
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user,$pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='graffiti';
49
+ $this->service_user=$user;
50
+ $this->service_password=$pass;
51
+ if (!$this->init()) return false;
52
+
53
+ $res=$this->get("http://www.graffiti.net/scripts/common/index.main?signin=1&lang=us");
54
+ if ($this->checkResponse("initial_get",$res))
55
+ $this->updateDebugBuffer('initial_get',"http://www.graffiti.net/scripts/common/index.main?signin=1&lang=us",'GET');
56
+ else
57
+ {
58
+ $this->updateDebugBuffer('initial_get',"http://www.graffiti.net/scripts/common/index.main?signin=1&lang=us",'GET',false);
59
+ $this->debugRequest();
60
+ $this->stopPlugin();
61
+ return false;
62
+ }
63
+
64
+ $form_action="http://www.graffiti.net/scripts/common/proxy.main";
65
+ $post_elements=array('domain'=>'graffiti.net','show_frame'=>'Enter','login'=>$user,'password'=>$pass,'v'=>$this->getElementString($res,'name="v" value="','"'),'u'=>$this->getElementString($res,'name="u" value="','"'));
66
+ $res=$this->post($form_action,$post_elements,true);
67
+ if ($this->checkResponse('login_post',$res))
68
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
69
+ else
70
+ {
71
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
72
+ $this->debugRequest();
73
+ $this->stopPlugin();
74
+ return false;
75
+ }
76
+
77
+ $this->login_ok="http://mymail.graffiti.net/scripts/addr/addressbook.cgi?showaddressbook=1";
78
+ return true;
79
+ }
80
+
81
+ /**
82
+ * Get the current user's contacts
83
+ *
84
+ * Makes all the necesarry requests to import
85
+ * the current user's contacts
86
+ *
87
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
88
+ */
89
+ public function getMyContacts()
90
+ {
91
+ if (!$this->login_ok)
92
+ {
93
+ $this->debugRequest();
94
+ $this->stopPlugin();
95
+ return false;
96
+ }
97
+ else $url=$this->login_ok;
98
+ $res=$this->get($url,true);
99
+ if ($this->checkResponse("url_contacts",$res))
100
+ $this->updateDebugBuffer('url_contacts',$url,'GET');
101
+ else
102
+ {
103
+ $this->updateDebugBuffer('url_contacts',$url,'GET',false);
104
+ $this->debugRequest();
105
+ $this->stopPlugin();
106
+ return false;
107
+ }
108
+
109
+ $contacts=array();
110
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
111
+ $xpath=new DOMXPath($doc);$query="//input";$data=$xpath->query($query);
112
+ foreach ($data as $node)
113
+ {
114
+ $nodeValue=$node->getAttribute('value');$email=$this->getElementString($nodeValue,'<','>');$name=$this->getElementString($nodeValue,'to_"','"');
115
+ if (!empty($email)) $contacts[$email]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$email);
116
+ }
117
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
118
+ return $this->returnContacts($contacts);
119
+ }
120
+
121
+ /**
122
+ * Terminate session
123
+ *
124
+ * Terminates the current user's session,
125
+ * debugs the request and reset's the internal
126
+ * debudder.
127
+ *
128
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
129
+ */
130
+ public function logout()
131
+ {
132
+ if (!$this->checkSession()) return false;
133
+ $res=$this->get("http://mymail.graffiti.net/scripts/mail/Outblaze.mail?logout=1&.noframe=1&a=1&",true);
134
+ $this->debugRequest();
135
+ $this->resetDebugger();
136
+ $this->stopPlugin();
137
+ return true;
138
+ }
139
+
140
+ }
141
+
142
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/hi5.plg.php ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Hi5',
4
+ 'version'=>'1.1.6',
5
+ 'description'=>"Get the contacts from a Hi5 account",
6
+ 'base_version'=>'1.6.7',
7
+ 'type'=>'social',
8
+ 'check_url'=>'http://www.hi5.com',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * Hi5 Plugin
14
+ *
15
+ * Imports user's contacts from Hi5 and sends messages
16
+ * using Hi5's internal messaging system.
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.4
20
+ */
21
+ class hi5 extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=50;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'email',
30
+ 'login_post'=>'friends',
31
+ 'url_friends'=>'friend-name',
32
+ 'url_message'=>'toIds',
33
+ 'send_message'=>'reqs'
34
+ );
35
+
36
+ /**
37
+ * Login function
38
+ *
39
+ * Makes all the necessary requests to authenticate
40
+ * the current user to the server.
41
+ *
42
+ * @param string $user The current user.
43
+ * @param string $pass The password for the current user.
44
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
45
+ */
46
+ public function login($user,$pass)
47
+ {
48
+ $this->resetDebugger();
49
+ $this->service='hi5';
50
+ $this->service_user=$user;
51
+ $this->service_password=$pass;
52
+ if (!$this->init()) return false;
53
+
54
+ $res=$this->get("http://www.hi5.com/");
55
+ if ($this->checkResponse("initial_get",$res))
56
+ $this->updateDebugBuffer('initial_get',"http://www.hi5.com/",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get',"http://www.hi5.com/",'GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+ $form_action="http://www.hi5.com/friend/login.do";
65
+ $post_elements=array(
66
+ 'email'=>$user,
67
+ 'password'=>$pass,
68
+ 'remember'=>'on'
69
+ );
70
+ $res=$this->post($form_action,$post_elements,true);
71
+ if ($this->checkResponse("login_post",$res))
72
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
73
+ else
74
+ {
75
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
76
+ $this->debugRequest();
77
+ $this->stopPlugin();
78
+ return false;
79
+ }
80
+ $url_friends="http://www.hi5.com/friend/viewFriends.do?abredirect=true";
81
+ $this->login_ok=$url_friends;
82
+ return true;
83
+ }
84
+
85
+ /**
86
+ * Get the current user's contacts
87
+ *
88
+ * Makes all the necesarry requests to import
89
+ * the current user's contacts
90
+ *
91
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
92
+ */
93
+ public function getMyContacts()
94
+ {
95
+ if (!$this->login_ok)
96
+ {
97
+ $this->debugRequest();
98
+ $this->stopPlugin();
99
+ return false;
100
+ }
101
+ else $url=$this->login_ok;
102
+ $res=$this->get($url,true);
103
+ $contacts=array();$mail_contacts=array();$url_next=false;
104
+ if ($this->checkResponse("url_friends",$res))
105
+ $this->updateDebugBuffer('url_friends',$url,'GET');
106
+ else
107
+ {
108
+ $this->updateDebugBuffer('url_friends',$url,'GET',false);
109
+ $this->debugRequest();
110
+ $this->stopPlugin();
111
+ return false;
112
+ }
113
+ $nr_of_friends=(int)$this->getElementString($res,'id="pagination-number">','<');$page=20;
114
+ do
115
+ {
116
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
117
+ $xpath=new DOMXPath($doc);$query="//div[@class='friend-name']";$data=$xpath->query($query);$id=false;
118
+ foreach ($data as $node)
119
+ {
120
+ $name=$node->childNodes->item(1)->nodeValue;$href=$node->childNodes->item(1)->getAttribute('href');$id=$this->getElementString($href,'p','-');
121
+ if (!empty($id)) $contacts[$id]=!empty($name)?$name:false;
122
+ }
123
+ $url_next_array=$this->getElementDOM($res,"//a[@class='link_pagination_arrow']",'href');
124
+ if (!empty($url_next_array[0]))
125
+ {$url_next=$this->getElementString($url_next_array[0],'/','offset=')."offset={$page}";$page+=20;$res=$this->get("http://hi5.com/{$url_next}",true);}
126
+ else $id=false;
127
+ }
128
+ while($id);
129
+ return $contacts;
130
+ }
131
+
132
+ /**
133
+ * Send message to contacts
134
+ *
135
+ * Sends a message to the contacts using
136
+ * the service's inernal messaging system
137
+ *
138
+ * @param string $cookie_file The location of the cookies file for the current session
139
+ * @param string $message The message being sent to your contacts
140
+ * @param array $contacts An array of the contacts that will receive the message
141
+ * @return mixed FALSE on failure.
142
+ */
143
+ public function sendMessage($session_id,$message,$contacts)
144
+ {
145
+ $countMessages=0;
146
+ foreach($contacts as $id=>$name)
147
+ {
148
+ $countMessages++;
149
+ $url_send_message="http://hi5.com/friend/mail/displayComposeMail.do?toIds={$id}";
150
+ $res=$this->get($url_send_message);
151
+ if ($this->checkResponse("url_message",$res))
152
+ $this->updateDebugBuffer('url_message',$url_send_message,'GET');
153
+ else
154
+ {
155
+ $this->updateDebugBuffer('url_message',$url_send_message,'GET',false);
156
+ $this->debugRequest();
157
+ $this->stopPlugin();
158
+ return false;
159
+ }
160
+ $form_action="http://hi5.com/friend/mail/sendMail.do";
161
+ $post_elements=array('toIds'=>$this->getElementString($res,"idToName['","'"),
162
+ 'subject'=>$message['subject'],
163
+ 'method'=>'send',
164
+ 'body'=>$message['body'],
165
+ 'timestamp'=>$this->getElementString($res,'name="timestamp" value="','"'),
166
+ 'mailOp'=>'',
167
+ 'senderId'=>'',
168
+ 'msgId'=>'',
169
+ 'submitSend'=>'Send Message'
170
+ );
171
+ $res=$this->post($form_action,$post_elements,true);
172
+ if ($this->checkResponse("send_message",$res))
173
+ $this->updateDebugBuffer('send_message',$url_send_message,'POST',true,$post_elements);
174
+ else
175
+ {
176
+ $this->updateDebugBuffer('send_message',$url_send_message,'POST',false,$post_elements);
177
+ $this->debugRequest();
178
+ $this->stopPlugin();
179
+ return false;
180
+ }
181
+ sleep($this->messageDelay);
182
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
183
+ }
184
+ }
185
+
186
+ /**
187
+ * Terminate session
188
+ *
189
+ * Terminates the current user's session,
190
+ * debugs the request and reset's the internal
191
+ * debudder.
192
+ *
193
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
194
+ */
195
+ public function logout()
196
+ {
197
+ if (!$this->checkSession()) return false;
198
+ $res=$this->get("http://hi5.com/friend/logoff.do",true);
199
+ $this->debugRequest();
200
+ $this->resetDebugger();
201
+ $this->stopPlugin();
202
+ return true;
203
+ }
204
+ }
205
+
206
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/hotmail.plg.php ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Live/Hotmail',
4
+ 'version'=>'1.6.3',
5
+ 'description'=>"Get the contacts from a Windows Live/Hotmail account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://login.live.com/login.srf?id=2',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(hotmail)/i','/(live)/i','/(msn)/i','/(chaishop)/i'),
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Live/Hotmail Plugin
15
+ *
16
+ * Imports user's contacts from Windows Live's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.5.8
20
+ */
21
+ class hotmail extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'LoginOptions',
30
+ 'login_post'=>'location.replace',
31
+ 'first_redirect'=>'self.location.href',
32
+ 'url_inbox'=>'peopleUrlDomain',
33
+ 'message_at_login'=>'peopleUrlDomain',
34
+ 'url_sent_to'=>'ContactList.aspx',
35
+ 'get_contacts'=>'\x26\x2364\x3',
36
+ );
37
+
38
+ /**
39
+ * Login function
40
+ *
41
+ * Makes all the necessary requests to authenticate
42
+ * the current user to the server.
43
+ *
44
+ * @param string $user The current user.
45
+ * @param string $pass The password for the current user.
46
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
47
+ */
48
+ function login($user,$pass)
49
+ {
50
+ $this->resetDebugger();
51
+ $this->service='hotmail';
52
+ $this->service_user=$user;
53
+ $this->service_password=$pass;
54
+ if (!$this->init()) return false;
55
+ $res=$this->get("http://login.live.com/login.srf?id=2",true);
56
+ if ($this->checkResponse('initial_get',$res))
57
+ $this->updateDebugBuffer('initial_get',"http://login.live.com/login.srf?id=2",'GET');
58
+ else
59
+ {
60
+ $this->updateDebugBuffer('initial_get',"http://login.live.com/login.srf?id=2",'GET',false);
61
+ $this->debugRequest();
62
+ $this->stopPlugin();
63
+ return false;
64
+ }
65
+
66
+ if (strlen($pass) > 16) $pass=substr($pass, 0, 16);
67
+ $post_action=$this->getElementString($res,'method="POST" target="_top" action="','"');
68
+ $post_elements=$this->getHiddenElements($res);$post_elements["LoginOptions"]=3;$post_elements["login"]=$user;$post_elements["passwd"]=$pass;
69
+ $res=$this->post($post_action,$post_elements,true);
70
+ if ($this->checkResponse("login_post",$res))
71
+ $this->updateDebugBuffer('login_post',"{$post_action}",'POST',true,$post_elements);
72
+ else
73
+ {
74
+ $this->updateDebugBuffer('login_post',"{$post_action}",'POST',false,$post_elements);
75
+ $this->debugRequest();
76
+ $this->stopPlugin();
77
+ return false;
78
+ }
79
+
80
+ $url_redirect=$this->getElementString($res,'.location.replace("','"');
81
+ $res=$this->get($url_redirect,true,true);
82
+ if ($this->checkResponse('first_redirect',$res))
83
+ $this->updateDebugBuffer('first_redirect',"{$url_redirect}",'GET');
84
+ else
85
+ {
86
+ $this->updateDebugBuffer('first_redirect',"{$url_redirect}",'GET',false);
87
+ $this->debugRequest();
88
+ $this->stopPlugin();
89
+ return false;
90
+ }
91
+
92
+ if(strpos($res,"self.location.href = '")!==false)
93
+ {
94
+ $url_redirect=urldecode(str_replace('\x', '%',$this->getElementString($res,"self.location.href = '","'")));
95
+ $base_url="http://".$this->getElementString($url_redirect,'http://','mail/');
96
+ $res=$this->get($url_redirect,true);
97
+ }
98
+
99
+ if (strpos($res,'MessageAtLoginForm')!==false)
100
+ {
101
+ $form_action=$base_url.'mail/'.html_entity_decode($this->getElementString($res,'method="post" action="','"'));
102
+ $post_elements=$this->getHiddenElements($res);$post_elements['TakeMeToInbox']='Continue';
103
+ $res=$this->post($form_action,$post_elements,true);
104
+ if ($this->checkResponse("message_at_login",$res))
105
+ $this->updateDebugBuffer('message_at_login',"{$form_action}",'POST',true,$post_elements);
106
+ else
107
+ {
108
+ $this->updateDebugBuffer('message_at_login',"{$form_action}",'POST',false,$post_elements);
109
+ $this->debugRequest();
110
+ $this->stopPlugin();
111
+ return false;
112
+ }
113
+ }
114
+ else
115
+ {
116
+ if ($this->checkResponse('url_inbox',$res))
117
+ $this->updateDebugBuffer('url_inbox',"{$url_redirect}",'GET');
118
+ else
119
+ {
120
+ $this->updateDebugBuffer('url_inbox',"{$url_redirect}",'GET',false);
121
+ $this->debugRequest();
122
+ $this->stopPlugin();
123
+ return false;
124
+ }
125
+ }
126
+
127
+ $this->login_ok=$base_url;
128
+ file_put_contents($this->getLogoutPath(),$base_url);
129
+ return true;
130
+ }
131
+
132
+ /**
133
+ * Get the current user's contacts
134
+ *
135
+ * Makes all the necesarry requests to import
136
+ * the current user's contacts
137
+ *
138
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
139
+ */
140
+ public function getMyContacts()
141
+ {
142
+ if (!$this->login_ok)
143
+ {
144
+ $this->debugRequest();
145
+ $this->stopPlugin();
146
+ return false;
147
+ }
148
+ else $base_url=$this->login_ok;
149
+ $res=$this->get("{$base_url}mail/EditMessageLight.aspx?n=");
150
+ if ($this->checkResponse('url_sent_to',$res))
151
+ $this->updateDebugBuffer('url_sent_to',"{$base_url}mail/EditMessageLight.aspx?n=",'GET');
152
+ else
153
+ {
154
+ $this->updateDebugBuffer('url_sent_to',"{$base_url}mail/EditMessageLight.aspx?n=",'GET',false);
155
+ $this->debugRequest();
156
+ $this->stopPlugin();
157
+ return false;
158
+ }
159
+
160
+ $urlContacts="{$base_url}mail/ContactList.aspx".$this->getElementString($res,'ContactList.aspx','"');
161
+ $res=$this->get($urlContacts);
162
+ if ($this->checkResponse('get_contacts',$res))
163
+ $this->updateDebugBuffer('get_contacts',"{$urlContacts}",'GET');
164
+ else
165
+ {
166
+ $this->updateDebugBuffer('get_contacts',"{$urlContacts}",'GET',false);
167
+ $this->debugRequest();
168
+ $this->stopPlugin();
169
+ return false;
170
+ }
171
+
172
+ $contacts=array();
173
+ $bulkStringArray=explode("['",$res);unset($bulkStringArray[0]);unset($bulkStringArray[count($bulkStringArray)]);
174
+ foreach($bulkStringArray as $stringValue)
175
+ {
176
+ $stringValue=str_replace(array("']],","'"),'',$stringValue);
177
+ if (strpos($stringValue,'0,0,0,')!==false)
178
+ {
179
+ $tempStringArray=explode(',',$stringValue);
180
+ if (!empty($tempStringArray[2])) $name=html_entity_decode(urldecode(str_replace('\x', '%', $tempStringArray[2])),ENT_QUOTES, "UTF-8");
181
+ }
182
+ else
183
+ {
184
+ $emailsArray=array();$emailsArray=explode('\x26\x2364\x3b',$stringValue);
185
+ if (count($emailsArray)>0)
186
+ {
187
+ //get all emails
188
+ $bulkEmails=explode(',',$stringValue);
189
+ if (!empty($bulkEmails)) foreach($bulkEmails as $valueEmail)
190
+ { $email=html_entity_decode(urldecode(str_replace('\x', '%', $valueEmail))); if(!empty($email)) { $contacts[$email]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$email);$email=false; } }
191
+ $name=false;
192
+ }
193
+ }
194
+ }
195
+ if (!empty($contacts[$this->service_user])) unset($contacts[$this->service_user]);
196
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
197
+ return $this->returnContacts($contacts);
198
+ }
199
+
200
+ /**
201
+ * Terminate session
202
+ *
203
+ * Terminates the current user's session,
204
+ * debugs the request and reset's the internal
205
+ * debudder.
206
+ *
207
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
208
+ */
209
+ public function logout()
210
+ {
211
+ if (!$this->checkSession()) return false;
212
+ if (file_exists($this->getLogoutPath()))
213
+ {
214
+ $url=file_get_contents($this->getLogoutPath());
215
+ $url_logout=$url."mail/logout.aspx";
216
+ $res=$this->get($url_logout,true);
217
+ }
218
+ $this->debugRequest();
219
+ $this->resetDebugger();
220
+ $this->stopPlugin();
221
+ return true;
222
+ }
223
+
224
+ }
225
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/hushmail.plg.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Hushmail',
4
+ 'version'=>'1.0.5',
5
+ 'description'=>"Get the contacts from an Hushmail account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'https://m.hush.com/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Hushmail Plugin
15
+ *
16
+ * Imports user's contacts from Hushmail's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class hushmail extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ protected $timeout=30;
26
+ public $debug_array=array(
27
+ 'initial_get'=>'passphrase',
28
+ 'login_post'=>'3Dmobile',
29
+ 'get_contacts'=>'compose_from',
30
+ 'url_contacts'=>'listItem'
31
+ );
32
+
33
+ /**
34
+ * Login function
35
+ *
36
+ * Makes all the necessary requests to authenticate
37
+ * the current user to the server.
38
+ *
39
+ * @param string $user The current user.
40
+ * @param string $pass The password for the current user.
41
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
42
+ */
43
+ public function login($user,$pass)
44
+ {
45
+ $this->resetDebugger();
46
+ $this->service='hushmail';
47
+ $this->service_user=$user;
48
+ $this->service_password=$pass;
49
+ if (!$this->init()) return false;
50
+ $res=$this->get("https://m.hush.com/",true);
51
+ if ($this->checkResponse('initial_get',$res))
52
+ $this->updateDebugBuffer('initial_get',"https://m.hush.com/",'GET');
53
+ else
54
+ {
55
+ $this->updateDebugBuffer('initial_get',"https://m.hush.com/",'GET',false);
56
+ $this->debugRequest();
57
+ $this->stopPlugin();
58
+ return false;
59
+ }
60
+
61
+ $form_action='https://m.hush.com'.$this->getElementString($res,'action="','"');
62
+ $post_elements=$this->getHiddenElements($res);$post_elements['user']=$user;$post_elements['passphrase']=$pass;
63
+ $res=$this->post($form_action,$post_elements,true);
64
+ if ($this->checkResponse("login_post",$res))
65
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
66
+ else
67
+ {
68
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
69
+ $this->debugRequest();
70
+ $this->stopPlugin();
71
+ return false;
72
+ }
73
+ $url_compose="https://m.hush.com/m/{$user}@hushmail.com/compose?next=%3Fskin%3Dmobile%26save_skin%3D1";
74
+ $this->login_ok=$url_compose;
75
+ return true;
76
+ }
77
+
78
+ /**
79
+ * Get the current user's contacts
80
+ *
81
+ * Makes all the necesarry requests to import
82
+ * the current user's contacts
83
+ *
84
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
85
+ */
86
+ public function getMyContacts()
87
+ {
88
+ if (!$this->login_ok)
89
+ {
90
+ $this->debugRequest();
91
+ $this->stopPlugin();
92
+ return false;
93
+ }
94
+ else $url = $this->login_ok;
95
+ $res=$this->get($url);
96
+ if ($this->checkResponse('get_contacts',$res))
97
+ $this->updateDebugBuffer('get_contacts',$url,'GET');
98
+ else
99
+ {
100
+ $this->updateDebugBuffer('get_contacts',$url,'GET',false);
101
+ $this->debugRequest();
102
+ $this->stopPlugin();
103
+ return false;
104
+ }
105
+
106
+ $form_action="https://m.hush.com".$this->getElementString($res,'action="','"');
107
+ $post_elements=$this->getHiddenElements($res);$post_elements['compose_from']="{$this->service_user}@hushmail.com";$post_elements['compose_encrypt']='on';$post_elements['compose_sign']='on';$post_elements['compose_save']='on';$post_elements['action']='Add contact (to)';
108
+ $res=$this->post($form_action,$post_elements,true);
109
+ if ($this->checkResponse("url_contacts",$res))
110
+ $this->updateDebugBuffer('url_contacts',"{$form_action}",'POST',true,$post_elements);
111
+ else
112
+ {
113
+ $this->updateDebugBuffer('url_contacts',"{$form_action}",'POST',false,$post_elements);
114
+ $this->debugRequest();
115
+ $this->stopPlugin();
116
+ return false;
117
+ }
118
+
119
+
120
+ $contacts=array();
121
+ $contacts_string_array=$this->getElementDOM($res,"//input[@type='checkbox']",'value');
122
+ foreach($contacts_string_array as $temp)
123
+ {
124
+ $temp=str_replace('>','',str_replace('<','',str_replace('"','',urldecode($temp))));
125
+ $contacts_array_temp=explode(' ',$temp);
126
+ if (isset($contacts_array_temp[1])) $contacts[$contacts_array_temp[1]]=array('first_name'=>(isset($contacts_array_temp[0])?$contacts_array_temp[0]:false),'email_1'=>$contacts_array_temp[1]);
127
+ }
128
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
129
+ return $this->returnContacts($contacts);
130
+ }
131
+
132
+
133
+ /**
134
+ * Terminate session
135
+ *
136
+ * Terminates the current user's session,
137
+ * debugs the request and reset's the internal
138
+ * debudder.
139
+ *
140
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
141
+ */
142
+ public function logout()
143
+ {
144
+ if (!$this->checkSession()) return false;
145
+ $logout_url="https://m.hush.com/authentication/caracuraa@hushmail.com/logout?skin=mobile&next_webapp_name=contacts_webapp&next_webapp_url_name=contacts";
146
+ $res = $this->get($logout_url,true);
147
+ $this->debugRequest();
148
+ $this->resetDebugger();
149
+ $this->stopPlugin();
150
+ return true;
151
+ }
152
+ }
153
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/hyves.plg.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Hyves
3
+ * You can Post Messages using Hyves system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Hyves',
7
+ 'version'=>'1.1.8',
8
+ 'description'=>"Get the contacts from a Hyves account",
9
+ 'base_version'=>'1.8.1',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.hyves.nl/?l1=mo',
12
+ 'requirement'=>'user',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * http://hyves.net/ Plugin
17
+ *
18
+ * Import user's contacts from Hyves and send private messages
19
+ * using Hyves system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.1.2
23
+ */
24
+ class hyves extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'domainname',
33
+ 'url_login'=>'auth_username',
34
+ 'login_post'=>'global_member_username',
35
+ 'url_profile'=>'listitem',
36
+ 'get_friends'=>'memberlistname',
37
+ 'url_friend'=>'accesskey="2"',
38
+ 'url_send_message'=>'postman',
39
+ 'send_message'=>'color: green;'
40
+ );
41
+
42
+ /**
43
+ * Login function
44
+ *
45
+ * Makes all the necessary requests to authenticate
46
+ * the current user to the server.
47
+ *
48
+ * @param string $user The current user.
49
+ * @param string $pass The password for the current user.
50
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
51
+ */
52
+ public function login($user,$pass)
53
+ {
54
+ $this->resetDebugger();
55
+ $this->service='hyves';
56
+ $this->service_user=$user;
57
+ $this->service_password=$pass;
58
+ if (!$this->init()) return false;
59
+
60
+ $res=$this->get("http://www.hyves.nl/?l1=mo");
61
+ if ($this->checkResponse("initial_get",$res))
62
+ $this->updateDebugBuffer('initial_get',"http://www.hyves.nl/?l1=mo",'GET');
63
+ else
64
+ {
65
+ $this->updateDebugBuffer('initial_get',"http://www.hyves.nl/?l1=mo",'GET',false);
66
+ $this->debugRequest();
67
+ $this->stopPlugin();
68
+ return false;
69
+ }
70
+ $form_action=html_entity_decode($this->getElementString($res,'form class="form" action="','"'));
71
+ $post_elements=$this->getHiddenElements($res);$post_elements['auth_username']=$user;$post_elements['auth_password']=$pass;$post_elements['login']='Login';
72
+ $res=$this->post($form_action,$post_elements,true);
73
+ if ($this->checkResponse("login_post",$res))
74
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
75
+ else
76
+ {
77
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
78
+ $this->debugRequest();
79
+ $this->stopPlugin();
80
+ return false;
81
+ }
82
+
83
+ $url_logout='http://www.hyves.nl/?module=authentication&action=logoutMobile'.html_entity_decode($this->getElementString($res,"?module=authentication&amp;action=logoutMobile",'"'));
84
+ $url_friends="http://www.hyves.nl/mini/hyver/{$user}/friends";
85
+ $this->login_ok=$url_friends;
86
+ file_put_contents($this->getLogoutPath(),$url_logout);
87
+ return true;
88
+ }
89
+
90
+ /**
91
+ * Get the current user's contacts
92
+ *
93
+ * Makes all the necesarry requests to import
94
+ * the current user's contacts
95
+ *
96
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
97
+ */
98
+ public function getMyContacts()
99
+ {
100
+ if (!$this->login_ok)
101
+ {
102
+ $this->debugRequest();
103
+ $this->stopPlugin();
104
+ return false;
105
+ }
106
+ else $url=$this->login_ok;
107
+ $res=$this->get($url);
108
+ if ($this->checkResponse("get_friends",$res))
109
+ $this->updateDebugBuffer('get_friends',$url,'GET');
110
+ else
111
+ {
112
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
113
+ $this->debugRequest();
114
+ $this->stopPlugin();
115
+ return false;
116
+ }
117
+ $contacts=array();$hasContacts=true;$page=0;
118
+ while ($hasContacts)
119
+ {
120
+ $hasContacts=false;
121
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
122
+ $xpath=new DOMXPath($doc);$query="//a[@class='memberlistname'][not(contains(@href,'".$this->service_user."'))]";$data=$xpath->query($query);
123
+ foreach($data as $node)
124
+ {$href=$node->getAttribute('href');$name=(string)$node->nodeValue;if (!empty($name)) $name=$name[0].$this->getElementString($name,$name[0],'(');if (!empty($href)) {$contacts[$href]=!empty($name)?utf8_decode($name):false;$hasContacts=true;}}
125
+ $page=$page+10;
126
+ $urlNext="http://www.hyves.nl/mini/hyver/{$this->service_user}/friends/?&startpos={$page}";
127
+ $res=$this->get($urlNext,true);
128
+ }
129
+ return $contacts;
130
+ }
131
+
132
+ /**
133
+ * Send message to contacts
134
+ *
135
+ * Sends a message to the contacts using
136
+ * the service's inernal messaging system
137
+ *
138
+ * @param string $cookie_file The location of the cookies file for the current session
139
+ * @param string $message The message being sent to your contacts
140
+ * @param array $contacts An array of the contacts that will receive the message
141
+ * @return mixed FALSE on failure.
142
+ */
143
+ public function sendMessage($session_id,$message,$contacts)
144
+ {
145
+ $countMessages=0;
146
+ foreach($contacts as $href=>$name)
147
+ {
148
+ $countMessages++;
149
+ $res=$this->get($href,true);
150
+ if ($this->checkResponse("url_friend",$res))
151
+ $this->updateDebugBuffer('url_friend',$href,'GET');
152
+ else
153
+ {
154
+ $this->updateDebugBuffer('url_friend',$href,'GET',false);
155
+ $this->debugRequest();
156
+ $this->stopPlugin();
157
+ return false;
158
+ }
159
+
160
+ $url_send_message_array=$this->getElementDOM($res,"//a[@accesskey='2']",'href');
161
+ $url_send_message='http://www.hyves.nl'.urldecode($url_send_message_array[0]);
162
+ $res=$this->get($url_send_message,true);
163
+ if ($this->checkResponse("url_send_message",$res))
164
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET');
165
+ else
166
+ {
167
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET',false);
168
+ $this->debugRequest();
169
+ $this->stopPlugin();
170
+ return false;
171
+ }
172
+ $form_action="http://www.hyves.nl/?l1=mo&l2=mb&l3=hm&l4=sendi";
173
+ $post_elements=array(
174
+ 'postman'=>'Message/send',
175
+ 'postman_secret'=>$this->getElementString($res,'postman_secret" value="','"'),
176
+ 'sitepositionurl'=>$this->getElementString($res,'name="sitepositionurl" value="','"'),
177
+ 'sendmessage_to'=>$this->getElementString($res,'sendmessage_to" value="','"'),
178
+ 'sendmessage_subject'=>$message['subject'],
179
+ 'sendmessage_body'=>$message['body'],
180
+ 'sendmessage_type'=>2,
181
+ 'bsend'=>'send'
182
+ );
183
+
184
+ $res=$this->post($form_action,$post_elements,true);
185
+ if ($this->checkResponse("send_message",$res))
186
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
187
+ else
188
+ {
189
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
190
+ $this->debugRequest();
191
+ $this->stopPlugin();
192
+ return false;
193
+ }
194
+ sleep($this->messageDelay);
195
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
196
+ }
197
+ }
198
+
199
+ /**
200
+ * Terminate session
201
+ *
202
+ * Terminates the current user's session,
203
+ * debugs the request and reset's the internal
204
+ * debudder.
205
+ *
206
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
207
+ */
208
+ public function logout()
209
+ {
210
+ if (!$this->checkSession()) return false;
211
+ if (file_exists($this->getLogoutPath()))
212
+ {
213
+ $url_logout=file_get_contents($this->getLogoutPath());
214
+ $res=$this->get($url_logout,true);
215
+ }
216
+ $this->debugRequest();
217
+ $this->resetDebugger();
218
+ $this->stopPlugin();
219
+ return true;
220
+ }
221
+ }
222
+
223
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/inbox.plg.php ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Inbox.com',
4
+ 'version'=>'1.0.6',
5
+ 'description'=>"Get the contacts from an Inbox.com account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'email',
8
+ 'check_url'=>'https://www.inbox.com/xm/login.aspx',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(inbox.com)/i'),
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Inbox.com Plugin
15
+ *
16
+ * Imports user's contacts from Inbox.com's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class inbox extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'ACT',
30
+ 'post_login'=>'Location:',
31
+ 'inbox'=>'accesskey="8"',
32
+ 'contacts'=>'checkbox'
33
+ );
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user,$pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='inbox';
49
+ $this->service_user=$user;
50
+ $this->service_password=$pass;
51
+ if (!$this->init()) return false;
52
+
53
+ $res=$this->get("https://www.inbox.com/xm/login.aspx");
54
+ if ($this->checkResponse('initial_get',$res))
55
+ $this->updateDebugBuffer('initial_get',"https://www.inbox.com/xm/login.aspx",'GET');
56
+ else
57
+ {
58
+ $this->updateDebugBuffer('initial_get',"https://www.inbox.com/xm/login.aspx",'GET',false);
59
+ $this->debugRequest();
60
+ $this->stopPlugin();
61
+ return false;
62
+ }
63
+ $form_action="https://www.inbox.com/xm/login.aspx";
64
+ $post_elements=array('ACT'=>'LGN',
65
+ 'login'=>$user,
66
+ 'pwd'=>$pass,
67
+ 'cmdLgn'=>'Sign In'
68
+ );
69
+ $res=$this->post($form_action,$post_elements,false,true,false,array(),false,false);
70
+ if ($this->checkResponse('post_login',$res))
71
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',true,$post_elements);
72
+ else
73
+ {
74
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',false,$post_elements);
75
+ $this->debugRequest();
76
+ $this->stopPlugin();
77
+ return false;
78
+ }
79
+
80
+ $base_url="http://".$this->getElementString($this->getElementString($res,"Location: ",PHP_EOL),"http://",'?ACT');
81
+ $url_redirect=trim(str_replace(" [following]","",$this->getElementString($res,"Location: ",PHP_EOL)));
82
+ $res=$this->get($url_redirect,true);
83
+ if ($this->checkResponse('inbox',$res))
84
+ $this->updateDebugBuffer('inbox',$url_redirect,'GET');
85
+ else
86
+ {
87
+ $this->updateDebugBuffer('inbox',$url_redirect,'GET',false);
88
+ $this->debugRequest();
89
+ $this->stopPlugin();
90
+ return false;
91
+ }
92
+
93
+
94
+ $url_contacts_array=$this->getElementDOM($res,"//a[@accesskey='8']",'href');
95
+ $url_contacts=array();$url_contacts=array($base_url,$url_contacts_array[0]);
96
+ $this->login_ok=$url_contacts;
97
+ file_put_contents($this->getLogoutPath(),$url_redirect);
98
+ return true;
99
+ }
100
+
101
+ /**
102
+ * Get the current user's contacts
103
+ *
104
+ * Makes all the necesarry requests to import
105
+ * the current user's contacts
106
+ *
107
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
108
+ */
109
+ public function getMyContacts()
110
+ {
111
+ if (!$this->login_ok)
112
+ {
113
+ $this->debugRequest();
114
+ $this->stopPlugin();
115
+ return false;
116
+ }
117
+ else $url=$this->login_ok;
118
+ //go to url adressbook
119
+ $res=$this->get($url[0].$url[1],true);
120
+
121
+ $form_action=$url[0]."default.aspx";$post_elements=$this->getHiddenElements($res);$post_elements['cmdADDR']="To: Addr";
122
+ $res=$this->post($form_action,$post_elements,true);
123
+ if ($this->checkResponse('contacts',$res))
124
+ $this->updateDebugBuffer('contacts',"{$form_action}",'POST',true,$post_elements);
125
+ else
126
+ {
127
+ $this->updateDebugBuffer('contacts',"{$form_action}",'POST',false,$post_elements);
128
+ $this->debugRequest();
129
+ $this->stopPlugin();
130
+ return false;
131
+ }
132
+ $contacts=array();$page=1;
133
+ $total_nr_friends_array=explode("of ",$this->getElementString($res,'<td align="center">','<'));if (!empty($total_nr_friends_array[1])) $total_nr_friends=trim($total_nr_friends_array[1]);else $total_nr_friends=0;$friend_contor=0;
134
+ while($total_nr_friends>$friend_contor)
135
+ {
136
+ $contacts_temp=$this->getElementDOM($res,"//input[@type='checkbox']",'value');
137
+ foreach($contacts_temp as $value)
138
+ {
139
+ $contacts_array=explode("<",$value);
140
+ if (!empty($contacts_array[1])) $contacts[str_replace(">","",$contacts_array[1])]=array('first_name'=>(!empty($contacts_array[0])?trim($contacts_array[0]):false),'email_1'=>str_replace(">","",$contacts_array[1]));
141
+ else $contacts[$value]=array('first_name'=>false,'email_1'=>$value);
142
+ $friend_contor++;
143
+ }
144
+ $page++;$res=$this->get("{$form_action}?ACT=CPAB&AF=1&CID=-1&PG={$page}");
145
+ }
146
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
147
+ return $this->returnContacts($contacts);
148
+ }
149
+
150
+ /**
151
+ * Terminate session
152
+ *
153
+ * Terminates the current user's session,
154
+ * debugs the request and reset's the internal
155
+ * debudder.
156
+ *
157
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
158
+ */
159
+ public function logout()
160
+ {
161
+ if (!$this->checkSession()) return false;
162
+ if (file_exists($this->getLogoutPath()))
163
+ {
164
+ $url=file_get_contents($this->getLogoutPath());
165
+ $url_logout=str_replace('?ACT=INIT','default.aspx?ACT=LGO',$url);
166
+ $res=$this->get($url_logout,true);
167
+ }
168
+ $this->debugRequest();
169
+ $this->resetDebugger();
170
+ $this->stopPlugin();
171
+ return true;
172
+ }
173
+
174
+ }
175
+
176
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/india.plg.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'India',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from an India account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://mail.india.com/scripts/common/index.main?signin=1&lang=us',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * India plugin
15
+ *
16
+ * Imports user's contacts from India AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.1
20
+ */
21
+ class india extends OpenInviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array('initial_get'=>'show_frame',
29
+ 'login_post'=>'ob=',
30
+ 'file_contacts'=>'Name'
31
+ );
32
+
33
+ /**
34
+ * Login function
35
+ *
36
+ * Makes all the necessary requests to authenticate
37
+ * the current user to the server.
38
+ *
39
+ * @param string $user The current user.
40
+ * @param string $pass The password for the current user.
41
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
42
+ */
43
+ public function login($user, $pass)
44
+ {
45
+ $this->resetDebugger();
46
+ $this->service='indiatimes';
47
+ $this->service_user=$user;
48
+ $this->service_password=$pass;
49
+ if (!$this->init()) return false;
50
+
51
+ $res = $this->get("http://mail.india.com/scripts/common/index.main?signin=1&lang=us");
52
+ if ($this->checkResponse("initial_get",$res))
53
+ $this->updateDebugBuffer('initial_get',"http://mail.india.com/scripts/common/index.main?signin=1&lang=us",'GET');
54
+ else
55
+ {
56
+ $this->updateDebugBuffer('initial_get',"http://mail.india.com/scripts/common/index.main?signin=1&lang=us",'GET',false);
57
+ $this->debugRequest();
58
+ $this->stopPlugin();
59
+ return false;
60
+ }
61
+
62
+ $form_action="http://mail.india.com/scripts/common/proxy.main";
63
+ $post_elements=array('show_frame'=>'Enter',
64
+ 'action'=>'login',
65
+ 'domain'=>'india.com',
66
+ 'u'=>$this->getElementString($res,'name="u" value="','"'),
67
+ 'v'=>$this->getElementString($res,'name="v" value="','"'),
68
+ 'mail_language'=>'us',
69
+ 'login'=>$user,
70
+ 'password'=>$pass,
71
+ );
72
+
73
+ $res=$this->post($form_action,$post_elements,true);
74
+ if ($this->checkResponse("login_post",$res))
75
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
76
+ else
77
+ {
78
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
79
+ $this->debugRequest();
80
+ $this->stopPlugin();
81
+ return false;
82
+ }
83
+
84
+ $url_export="http://mymail.india.com/scripts/addr/external.cgi?.ob=a&gab=1";
85
+ $this->login_ok=$url_export;
86
+ return true;
87
+ }
88
+
89
+ /**
90
+ * Get the current user's contacts
91
+ *
92
+ * Makes all the necesarry requests to import
93
+ * the current user's contacts
94
+ *
95
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
96
+ */
97
+ public function getMyContacts()
98
+ {
99
+ if (!$this->login_ok)
100
+ {
101
+ $this->debugRequest();
102
+ $this->stopPlugin();
103
+ return false;
104
+ }
105
+ else $url=$this->login_ok;
106
+
107
+ $form_action=$url;
108
+ $post_elements=array('showexport'=>'showexport','action'=>'export','login'=>"{$this->service_user}@india.com",'format'=>'csv');
109
+ $res=$this->post($form_action,$post_elements);
110
+ if ($this->checkResponse("file_contacts",$res))
111
+ $this->updateDebugBuffer('file_contacts',$form_action,'POST',true,$post_elements);
112
+ else
113
+ {
114
+ $this->updateDebugBuffer('file_contacts',$form_action,'POST',false,$post_elements);
115
+ $this->debugRequest();
116
+ $this->stopPlugin();
117
+ return false;
118
+ }
119
+
120
+ $temp=$this->parseCSV($res);
121
+ $contacts=array();
122
+ foreach ($temp as $values)
123
+ {
124
+ if (!empty($values[4]))
125
+ $contacts[$values[4]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
126
+ 'middle_name'=>(!empty($values[1])?$values[1]:false),
127
+ 'last_name'=>(!empty($values[2])?$values[2]:false),
128
+ 'nickname'=>(!empty($values[3])?$values[3]:false),
129
+ 'email_1'=>(!empty($values[4])?$values[4]:false),
130
+ 'email_2'=>(!empty($values[12])?$values[12]:false),
131
+ 'email_3'=>(!empty($values[13])?$values[13]:false),
132
+ 'organization'=>false,
133
+ 'phone_mobile'=>(!empty($values[10])?$values[10]:false),
134
+ 'phone_home'=>(!empty($values[6])?$values[6]:false),
135
+ 'pager'=>(!empty($values[8])?$values[8]:false),
136
+ 'address_home'=>false,
137
+ 'address_city'=>(!empty($values[28])?$values[28]:false),
138
+ 'address_state'=>(!empty($values[29])?$values[29]:false),
139
+ 'address_country'=>(!empty($values[31])?$values[31]:false),
140
+ 'postcode_home'=>(!empty($values[30])?$values[30]:false),
141
+ 'company_work'=>(!empty($values[17])?$values[17]:false),
142
+ 'address_work'=>false,
143
+ 'address_work_city'=>(!empty($values[21])?$values[21]:false),
144
+ 'address_work_country'=>(!empty($values[24])?$values[24]:false),
145
+ 'address_work_state'=>(!empty($values[22])?$values[22]:false),
146
+ 'address_work_postcode'=>(!empty($values[23])?$values[23]:false),
147
+ 'fax_work'=>false,
148
+ 'phone_work'=>(!empty($values[7])?$values[7]:false),
149
+ 'website'=>(!empty($values[14])?$values[14]:false),
150
+ 'isq_messenger'=>false,
151
+ 'skype_essenger'=>false,
152
+ 'yahoo_essenger'=>false,
153
+ 'msn_messenger'=>false,
154
+ 'aol_messenger'=>false,
155
+ 'other_messenger'=>false,
156
+ );
157
+ }
158
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
159
+ return $this->returnContacts($contacts);
160
+ }
161
+
162
+ /**
163
+ * Terminate session
164
+ *
165
+ * Terminates the current user's session,
166
+ * debugs the request and reset's the internal
167
+ * debudder.
168
+ *
169
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
170
+ */
171
+ public function logout()
172
+ {
173
+ if (!$this->checkSession()) return false;
174
+ $res=$this->get("http://mb.indiatimes.com/it/logout.jsp",true);
175
+ $this->debugRequest();
176
+ $this->resetDebugger();
177
+ $this->stopPlugin();
178
+ }
179
+ }
180
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/indiatimes.plg.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'IndiaTimes',
4
+ 'version'=>'1.0.7',
5
+ 'description'=>"Get the contacts from an IndiaTimes account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://in.indiatimes.com/default1.cms',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * IndiaTimes Plugin
15
+ *
16
+ * Imports user's contacts from IndiaTimes' AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.3
20
+ */
21
+ class indiatimes extends OpenInviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+
27
+ public $debug_array=array('initial_get'=>'passwd',
28
+ 'login_post'=>'Location',
29
+ 'inbox_url'=>'sunsignid="2"',
30
+ 'file_contacts'=>'email'
31
+ );
32
+
33
+ /**
34
+ * Login function
35
+ *
36
+ * Makes all the necessary requests to authenticate
37
+ * the current user to the server.
38
+ *
39
+ * @param string $user The current user.
40
+ * @param string $pass The password for the current user.
41
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
42
+ */
43
+ public function login($user, $pass)
44
+ {
45
+ $this->resetDebugger();
46
+ $this->service='indiatimes';
47
+ $this->service_user=$user;
48
+ $this->service_password=$pass;
49
+ if (!$this->init()) return false;
50
+
51
+ $res = $this->get("http://in.indiatimes.com/default1.cms");
52
+ if ($this->checkResponse("initial_get",$res))
53
+ $this->updateDebugBuffer('initial_get',"http://in.indiatimes.com/default1.cms",'GET');
54
+ else
55
+ {
56
+ $this->updateDebugBuffer('initial_get',"http://in.indiatimes.com/default1.cms",'GET',false);
57
+ $this->debugRequest();
58
+ $this->stopPlugin();
59
+ return false;
60
+ }
61
+
62
+ $form_action=html_entity_decode($this->getElementString($res,'return checkVal(this);" action="','"'));
63
+ $post_elements=array('login'=>$user,
64
+ 'passwd'=>$pass,
65
+ 'Sign in'=>'Sign In'
66
+ );
67
+
68
+ $res=$this->post($form_action,$post_elements,true);
69
+
70
+ if ($this->checkResponse("login_post",$res))
71
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
72
+ else
73
+ {
74
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
75
+ $this->debugRequest();
76
+ $this->stopPlugin();
77
+ return false;
78
+ }
79
+
80
+ $basepath=$this->getElementString($res,"Location: ",'jsp')."jsp";
81
+ $res=$this->get($basepath,true);
82
+
83
+ if ($this->checkResponse("inbox_url",$res))
84
+ $this->updateDebugBuffer('inbox_url',$basepath,'GET');
85
+ else
86
+ {
87
+ $this->updateDebugBuffer('inbox_url',$basepath,'GET',false);
88
+ $this->debugRequest();
89
+ $this->stopPlugin();
90
+ return false;
91
+ }
92
+
93
+ $url_file_contacts=str_replace("/it/login.jsp","",$basepath)."/home/{$user}/Contacts.csv";
94
+
95
+ $this->login_ok=$url_file_contacts;
96
+ return true;
97
+ }
98
+
99
+ /**
100
+ * Get the current user's contacts
101
+ *
102
+ * Makes all the necesarry requests to import
103
+ * the current user's contacts
104
+ *
105
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
106
+ */
107
+ public function getMyContacts()
108
+ {
109
+ if (!$this->login_ok)
110
+ {
111
+ $this->debugRequest();
112
+ $this->stopPlugin();
113
+ return false;
114
+ }
115
+ else $url=$this->login_ok;
116
+ $res=$this->get($url);
117
+
118
+ if ($this->checkResponse("file_contacts",$res))
119
+ $this->updateDebugBuffer('file_contacts',$url,'GET');
120
+ else
121
+ {
122
+ $this->updateDebugBuffer('file_contacts',$url,'GET',false);
123
+ $this->debugRequest();
124
+ $this->stopPlugin();
125
+ return false;
126
+ }
127
+
128
+ $temp=$this->parseCSV($res);
129
+ $contacts=array();
130
+ foreach ($temp as $values)
131
+ {
132
+ if (!empty($values[0]))
133
+ $contacts[$values[0]]=array('first_name'=>(!empty($values[4])?$values[0]:false),
134
+ 'middle_name'=>(!empty($values[5])?$values[2]:false),
135
+ 'last_name'=>(!empty($values[6])?$values[6]:false),
136
+ 'nickname'=>false,
137
+ 'email_1'=>(!empty($values[0])?$values[0]:false),
138
+ 'email_2'=>(!empty($values[1])?$values[1]:false),
139
+ 'email_3'=>(!empty($values[2])?$values[2]:false),
140
+ 'organization'=>false,
141
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
142
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
143
+ 'pager'=>false,
144
+ 'address_home'=>false,
145
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
146
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
147
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
148
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
149
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
150
+ 'address_work'=>false,
151
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
152
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
153
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
154
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
155
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
156
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
157
+ 'website'=>(!empty($values[12])?$values[12]:false),
158
+ 'isq_messenger'=>false,
159
+ 'skype_essenger'=>false,
160
+ 'yahoo_essenger'=>false,
161
+ 'msn_messenger'=>false,
162
+ 'aol_messenger'=>false,
163
+ 'other_messenger'=>false,
164
+ );
165
+ }
166
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
167
+ return $this->returnContacts($contacts);
168
+ }
169
+
170
+ /**
171
+ * Terminate session
172
+ *
173
+ * Terminates the current user's session,
174
+ * debugs the request and reset's the internal
175
+ * debudder.
176
+ *
177
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
178
+ */
179
+ public function logout()
180
+ {
181
+ if (!$this->checkSession()) return false;
182
+ $res=$this->get("http://mb.indiatimes.com/it/logout.jsp",true);
183
+ $this->debugRequest();
184
+ $this->resetDebugger();
185
+ $this->stopPlugin();
186
+ }
187
+ }
188
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/inet.plg.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Inet',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Inet account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://inet.ua/index.php',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(inet.ua)/i','/(fm.com.ua)/i'),
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * Inet Plugin
15
+ *
16
+ * Imports user's contacts from Inet AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class inet extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'login_username',
30
+ 'login_post'=>'frame',
31
+ 'url_redirect'=>'passport',
32
+ 'url_export'=>'FORENAME',
33
+ );
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user,$pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='inet';
49
+ $this->service_user=$user;
50
+ $this->service_password=$pass;
51
+ if (!$this->init()) return false;
52
+
53
+ $res=$this->get("http://inet.ua/index.php");
54
+ if ($this->checkResponse("initial_get",$res))
55
+ $this->updateDebugBuffer('initial_get',"http://inet.ua/index.php",'GET');
56
+ else
57
+ {
58
+ $this->updateDebugBuffer('initial_get',"http://inet.ua/index.php",'GET',false);
59
+ $this->debugRequest();
60
+ $this->stopPlugin();
61
+ return false;
62
+ }
63
+
64
+ $user_array=explode('@',$user);$username=$user_array[0];
65
+ $form_action="http://newmail.inet.ua/login.php";
66
+ $post_elements=array('username'=>$username,'password'=>$pass,'server_id'=>0,'template'=>'v-webmail','language'=>'ru','login_username'=>$username,'servname'=>'inet.ua','login_password'=>$pass,'version'=>1,'x'=>rand(1,100),'y'=>rand(1,100));
67
+ $res=$this->post($form_action,$post_elements,true);
68
+ if ($this->checkResponse('login_post',$res))
69
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
70
+ else
71
+ {
72
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
73
+ $this->debugRequest();
74
+ $this->stopPlugin();
75
+ return false;
76
+ }
77
+
78
+ $this->login_ok="http://newmail.inet.ua/download.php?act=process_export&method=csv&addresses=all";
79
+ return true;
80
+ }
81
+
82
+ /**
83
+ * Get the current user's contacts
84
+ *
85
+ * Makes all the necesarry requests to import
86
+ * the current user's contacts
87
+ *
88
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
89
+ */
90
+ public function getMyContacts()
91
+ {
92
+ if (!$this->login_ok)
93
+ {
94
+ $this->debugRequest();
95
+ $this->stopPlugin();
96
+ return false;
97
+ }
98
+ else $url=$this->login_ok;
99
+ $res=$this->get($url);
100
+ if ($this->checkResponse("url_export",$res))
101
+ $this->updateDebugBuffer('url_export',$url,'GET');
102
+ else
103
+ {
104
+ $this->updateDebugBuffer('url_export',$url,'GET',false);
105
+ $this->debugRequest();
106
+ $this->stopPlugin();
107
+ return false;
108
+ }
109
+
110
+ $tempFile=explode(PHP_EOL,$res);$contacts=array();unset($tempFile[0]);
111
+ foreach ($tempFile as $valuesTemp)
112
+ {
113
+ $values=explode('~',$valuesTemp);
114
+ if (!empty($values[3]))
115
+ $contacts[$values[3]]=array('first_name'=>(!empty($values[1])?$values[1]:false),
116
+ 'middle_name'=>(!empty($values[2])?$values[2]:false),
117
+ 'last_name'=>false,
118
+ 'nickname'=>false,
119
+ 'email_1'=>(!empty($values[3])?$values[3]:false),
120
+ 'email_2'=>(!empty($values[4])?$values[4]:false),
121
+ 'email_3'=>(!empty($values[5])?$values[5]:false),
122
+ 'organization'=>false,
123
+ 'phone_mobile'=>(!empty($values[8])?$values[8]:false),
124
+ 'phone_home'=>(!empty($values[6])?$values[6]:false),
125
+ 'pager'=>false,
126
+ 'address_home'=>false,
127
+ 'address_city'=>(!empty($values[11])?$values[11]:false),
128
+ 'address_state'=>(!empty($values[12])?$values[12]:false),
129
+ 'address_country'=>(!empty($values[14])?$values[14]:false),
130
+ 'postcode_home'=>(!empty($values[13])?$values[13]:false),
131
+ 'company_work'=>false,
132
+ 'address_work'=>false,
133
+ 'address_work_city'=>false,
134
+ 'address_work_country'=>false,
135
+ 'address_work_state'=>false,
136
+ 'address_work_postcode'=>false,
137
+ 'fax_work'=>false,
138
+ 'phone_work'=>(!empty($values[7])?$values[7]:false),
139
+ 'website'=>false,
140
+ 'isq_messenger'=>false,
141
+ 'skype_essenger'=>false,
142
+ 'yahoo_essenger'=>false,
143
+ 'msn_messenger'=>false,
144
+ 'aol_messenger'=>false,
145
+ 'other_messenger'=>false,
146
+ );
147
+ }
148
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
149
+ return $this->returnContacts($contacts);
150
+ }
151
+
152
+ /**
153
+ * Terminate session
154
+ *
155
+ * Terminates the current user's session,
156
+ * debugs the request and reset's the internal
157
+ * debudder.
158
+ *
159
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
160
+ */
161
+ public function logout()
162
+ {
163
+ if (!$this->checkSession()) return false;
164
+ $res=$this->get('http://newmail.inet.ua/logout.php?vwebmailsession=',true);
165
+ $this->debugRequest();
166
+ $this->resetDebugger();
167
+ $this->stopPlugin();
168
+ return true;
169
+ }
170
+
171
+ }
172
+
173
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/interia.plg.php ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Interia',
4
+ 'version'=>'1.0.7',
5
+ 'description'=>"Get the contacts from an Interia.pl account, Plugin developed by Bartosz Zarczynski",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://poczta.interia.pl/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(interia.pl)/i', '/(poczta.fm)/i', '/(interia.eu)/i', '/(1gb.pl)/i', '/(2gb.pl)/i', '/(vip.interia.pl)/i', '/(serwus.pl)/i', '/(akcja.pl)/i', '/(czateria.pl)/i', '/(znajomi.pl)/i'),
11
+ 'imported_details'=>array('first_name','last_name','email_1'),
12
+ );
13
+ /**
14
+ * Interia.pl Plugin
15
+ *
16
+ * Imports user's contacts from Interia.pl account
17
+ *
18
+ * @author Bartosz Zarczynski
19
+ * @version 1.0.0
20
+ */
21
+ class interia extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+
29
+ public $debug_array=array('initial_get'=>'pocztaLoginForm',
30
+ 'login_post'=>'side-folders',
31
+ 'url_contact'=>'while(1)'
32
+ );
33
+ private $sid;
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user, $pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='interia';
49
+ $this->service_user=$user;
50
+ $this->service_password=$pass;
51
+ if (!$this->init()) return false;
52
+ $res = $this->get("http://poczta.interia.pl/",true);
53
+
54
+ if ($this->checkResponse("initial_get",$res))
55
+ $this->updateDebugBuffer('initial_get',"http://poczta.interia.pl/",'GET');
56
+ else
57
+ {
58
+ $this->updateDebugBuffer('initial_get',"http://poczta.interia.pl/",'GET',false);
59
+ $this->debugRequest();
60
+ $this->stopPlugin();
61
+ return false;
62
+ }
63
+
64
+ $at = strpos($user, '@');
65
+ $domain = substr($user, $at+1, strlen($user)-$at);
66
+
67
+ $form_action="http://ssl.interia.pl/login.html?classicMail=1";
68
+ $post_elements=array('login'=>$user,
69
+ 'pass'=>$pass,
70
+ 'domain' => $domain,
71
+ 'htmlMail' => 'checked',
72
+ 'referer' => 'http://poczta.interia.pl/poczta/'
73
+ );
74
+
75
+ $res=$this->post($form_action,$post_elements, true, true, false);
76
+
77
+ if ($this->checkResponse("login_post",$res))
78
+ $this->updateDebugBuffer('login_post',"http://ssl.interia.pl/login.html?classicMail=1",'GET');
79
+ else
80
+ {
81
+ $this->updateDebugBuffer('login_post',"http://ssl.interia.pl/login.html?classicMail=1",'GET',false);
82
+ $this->debugRequest();
83
+ $this->stopPlugin();
84
+ return false;
85
+ }
86
+
87
+ $pos = strpos($res, "logout,uid,");
88
+ $this->sid = substr($res, $pos+11, 16);
89
+
90
+ $this->login_ok = "http://poczta.interia.pl/html/getcontacts,all,1,uid,$this->sid?inpl_network_request=true";
91
+
92
+ return true;
93
+ }
94
+
95
+ /**
96
+ * Get the current user's contacts
97
+ *
98
+ * Makes all the necesarry requests to import
99
+ * the current user's contacts
100
+ *
101
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
102
+ */
103
+ public function getMyContacts()
104
+ {
105
+ if (!$this->login_ok)
106
+ {
107
+ $this->debugRequest();
108
+ $this->stopPlugin();
109
+ return false;
110
+ }
111
+ else $url=$this->login_ok;
112
+ $res=$this->get($url,true);
113
+
114
+ if ($this->checkResponse("url_contact",$res))
115
+ $this->updateDebugBuffer('url_contact',$this->login_ok,'GET');
116
+ else
117
+ {
118
+ $this->updateDebugBuffer('url_contact',$this->login_ok,'GET',false);
119
+ $this->debugRequest();
120
+ $this->stopPlugin();
121
+ return false;
122
+ }
123
+
124
+ $noheader = substr($res, strpos($res, "while(1);[{") + 11, strlen($res) - 2);
125
+ $lines = explode("},{", $noheader);
126
+ $i = 0;
127
+ foreach ($lines as $line)
128
+ {
129
+ $data[$i] = explode(",", $line);
130
+ $i++;
131
+ }
132
+
133
+ $contacts = array();
134
+ foreach ($data as $line=>$param)
135
+ {
136
+ foreach ($param as $x)
137
+ {
138
+ $pos_mail = strpos($x, "email");
139
+ $email = substr($x, 9, strlen($x)-10);
140
+ $pos_firstname = strpos($x, "firstName");
141
+ if ($pos_firstname != false) $firstname = substr($x, 13, strlen($x)-14);
142
+ $pos_lastname = strpos($x, "lastName");
143
+ if ($pos_lastname != false) $lastname = substr($x, 12, strlen($x)-13);
144
+ if ($pos_mail != false) $contacts[$email] =array('first_name'=>$firstname,'last_name'=>$lastname,'email_1'=>$email);
145
+ }
146
+ }
147
+
148
+ return $this->returnContacts($contacts);
149
+ }
150
+
151
+ /**
152
+ * Terminate session
153
+ *
154
+ * Terminates the current user's session,
155
+ * debugs the request and reset's the internal
156
+ * debudder.
157
+ *
158
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
159
+ */
160
+ public function logout()
161
+ {
162
+ if (!$this->checkSession()) return false;
163
+ $res = $this->get("http://poczta.interia.pl/html/logout,uid,$this->sid", true);
164
+ $this->debugRequest();
165
+ $this->resetDebugger();
166
+ $this->stopPlugin();
167
+ return true;
168
+ }
169
+ }
170
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/katamail.plg.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'KataMail',
4
+ 'version'=>'1.1.0',
5
+ 'description'=>"Get the contacts from a KataMail account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://webmail.katamail.com',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(katamail.com)/i'),
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger')
12
+ );
13
+ /**
14
+ * KataMail Plugin
15
+ *
16
+ * Imports user's contacts from KataMail's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.5
20
+ */
21
+ class katamail extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=false;
25
+ private $server,$id = "";
26
+ protected $timeout=30;
27
+ public $debug_array=array(
28
+ 'main_redirect'=>'location.href'
29
+ );
30
+
31
+ /**
32
+ * Login function
33
+ *
34
+ * Makes all the necessary requests to authenticate
35
+ * the current user to the server.
36
+ *
37
+ * @param string $user The current user.
38
+ * @param string $pass The password for the current user.
39
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
40
+ */
41
+ public function login($user, $pass)
42
+ {
43
+ $this->resetDebugger();
44
+ $this->service='katamail';
45
+ $this->service_user=$user;
46
+ $this->service_password=$pass;
47
+ if (!$this->init()) return false;
48
+ $postvars = array(
49
+ "Language"=>"italiano",
50
+ "pop3host"=>"katamail.com",
51
+ "username"=>$user,
52
+ "LoginType"=>"xp",
53
+ "language"=>"italiano",
54
+ "MailType"=>"imap",
55
+ "email"=>$user."@katamail.com",
56
+ "password"=>$pass );
57
+ $res = $this->get("http://webmail.katamail.com", true);
58
+ $res = $this->post("http://webmail.katamail.com/atmail.php", $postvars, true);
59
+ $res = htmlentities($res);
60
+ if ($this->checkResponse("main_redirect",$res))
61
+ $this->updateDebugBuffer('main_redirect',"http://webmail.katamail.com/atmail.php",'POST');
62
+ else
63
+ {
64
+ $this->updateDebugBuffer('main_redirect',"http://webmail.katamail.com/atmail.php",'POST',false);
65
+ $this->debugRequest();
66
+ $this->stopPlugin();
67
+ return false;
68
+ }
69
+ $this->login_ok = "http://webmail.katamail.com/abook.php?func=export&abookview=personal";
70
+ return true;
71
+ }
72
+
73
+ /**
74
+ * Get the current user's contacts
75
+ *
76
+ * Makes all the necesarry requests to import
77
+ * the current user's contacts
78
+ *
79
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
80
+ */
81
+ public function getMyContacts()
82
+ {
83
+ if (!$this->login_ok)
84
+ {
85
+ $this->debugRequest();
86
+ $this->stopPlugin();
87
+ return false;
88
+ }
89
+ else
90
+ {
91
+ $contacts = array();
92
+ $res = $this->get($this->login_ok);
93
+ $temp=$this->parseCSV($res);
94
+ foreach ($temp as $values)
95
+ {
96
+ if (!empty($values[1]))
97
+ $contacts[$values[1]]=array('first_name'=>(!empty($values[6])?$values[6]:false),
98
+ 'middle_name'=>(!empty($values[18])?$values[18]:false),
99
+ 'last_name'=>(!empty($values[17])?$values[17]:false),
100
+ 'nickname'=>false,
101
+ 'email_1'=>(!empty($values[1])?$values[1]:false),
102
+ 'email_2'=>(!empty($values[2])?$values[2]:false),
103
+ 'email_3'=>(!empty($values[3])?$values[3]:false),
104
+ 'organization'=>false,
105
+ 'phone_mobile'=>(!empty($values[12])?$values[12]:false),
106
+ 'phone_home'=>(!empty($values[13])?$values[13]:false),
107
+ 'pager'=>false,
108
+ 'address_home'=>false,
109
+ 'address_city'=>(!empty($values[9])?$values[9]:false),
110
+ 'address_state'=>(!empty($values[14])?$values[14]:false),
111
+ 'address_country'=>(!empty($values[10])?$values[10]:false),
112
+ 'postcode_home'=>false,
113
+ 'company_work'=>(!empty($values[24])?$values[24]:false),
114
+ 'address_work'=>(!empty($values[22])?$values[22]:false),
115
+ 'address_work_city'=>(!empty($values[23])?$values[23]:false),
116
+ 'address_work_country'=>(!empty($values[25])?$values[25]:false),
117
+ 'address_work_state'=>(!empty($values[31])?$values[31]:false),
118
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
119
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
120
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
121
+ 'website'=>(!empty($values[12])?$values[12]:false),
122
+ 'isq_messenger'=>false,
123
+ 'skype_essenger'=>false,
124
+ 'yahoo_essenger'=>false,
125
+ 'msn_messenger'=>false,
126
+ 'aol_messenger'=>false,
127
+ 'other_messenger'=>false,
128
+ );
129
+ }
130
+ }
131
+ $this->showContacts = true;
132
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
133
+ return $this->returnContacts($contacts);
134
+ }
135
+
136
+ /**
137
+ * Terminate session
138
+ *
139
+ * Terminates the current user's session,
140
+ * debugs the request and reset's the internal
141
+ * debudder.
142
+ *
143
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
144
+ */
145
+ public function logout()
146
+ {
147
+ if (!$this->checkSession()) return false;
148
+ $res=$this->get("http://webmail.katamail.com/index.php?func=logout");
149
+ $this->debugRequest();
150
+ $this->resetDebugger();
151
+ $this->stopPlugin();
152
+ return true;
153
+ }
154
+ }
155
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/kids.plg.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Kids',
4
+ 'version'=>'1.0.2',
5
+ 'description'=>"Get the contacts from a Kids account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.kids.co.uk/email/index.php',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Kids Plugin
15
+ *
16
+ * Import user's contacts from Kids account
17
+ *
18
+ *
19
+ * @author OpenInviter
20
+ * @version 1.0.0
21
+ */
22
+ class kids extends openinviter_base
23
+ {
24
+ private $login_ok=false;
25
+ public $showContacts=true;
26
+ public $internalError=false;
27
+ protected $timeout=30;
28
+
29
+ public $debug_array=array(
30
+ 'initial_get'=>'login_id',
31
+ 'login_post'=>'frame',
32
+ 'url_contacts'=>'doaddresses.php?_MATRIXaction=',
33
+ );
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user,$pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='kids';
49
+ $this->service_user=$user;
50
+ $this->service_password=$pass;
51
+ if (!$this->init()) return false;
52
+
53
+ $res=$this->get("http://www.kids.co.uk/email/index.php",true);
54
+ if ($this->checkResponse("initial_get",$res))
55
+ $this->updateDebugBuffer('initial_get',"http://www.kids.co.uk/email/index.php",'GET');
56
+ else
57
+ {
58
+ $this->updateDebugBuffer('initial_get',"http://www.kids.co.uk/email/index.php",'GET',false);
59
+ $this->debugRequest();
60
+ $this->stopPlugin();
61
+ return false;
62
+ }
63
+
64
+ $form_action="http://www.kids.co.uk/email/home/dologin.php";
65
+ $post_elements=array('did'=>2,
66
+ 'login_id'=>$user,
67
+ 'did'=>2,
68
+ 'login_pwd'=>$pass,
69
+ );
70
+
71
+ $res=$this->post($form_action,$post_elements,true);
72
+ if ($this->checkResponse("login_post",$res))
73
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
74
+ else
75
+ {
76
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
77
+ $this->debugRequest();
78
+ $this->stopPlugin();
79
+ return false;
80
+ }
81
+
82
+ $url_addressbook='http://www.kids.co.uk/email/home/addressbook.php';
83
+ $this->login_ok=$url_addressbook;
84
+ return true;
85
+ }
86
+
87
+ /**
88
+ * Get the current user's contacts
89
+ *
90
+ * Makes all the necesarry requests to import
91
+ * the current user's contacts
92
+ *
93
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
94
+ */
95
+ public function getMyContacts()
96
+ {
97
+ if (!$this->login_ok)
98
+ {
99
+ $this->debugRequest();
100
+ $this->stopPlugin();
101
+ return false;
102
+ }
103
+ else $url=$this->login_ok;
104
+ $res=$this->get($url);
105
+ if ($this->checkResponse("url_contacts",$res))
106
+ $this->updateDebugBuffer('url_contacts',$url,'GET');
107
+ else
108
+ {
109
+ $this->updateDebugBuffer('url_contacts',$url,'GET',false);
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+
115
+ $contacts=array();
116
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
117
+ $xpath=new DOMXPath($doc);$query="//a";$data=$xpath->query($query);$odd=true;
118
+ foreach($data as $node)
119
+ {
120
+ if (strpos($node->getAttribute('href'),'doaddresses.php?_MATRIXaction=Modify')!==false)
121
+ {
122
+ if ($odd) $names[]=$node->nodeValue;else $emails[]=$node->nodeValue;
123
+ $odd=!$odd;
124
+ }
125
+ }
126
+ if (!empty($names)) foreach($names as $key=>$value) if(!empty($emails[$key])) $contacts[$emails[$key]]=array('first_name'=>$value,'email_1'=>$emails[$key]);
127
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
128
+ return $this->returnContacts($contacts);
129
+ }
130
+
131
+ /**
132
+ * Terminate session
133
+ *
134
+ * Terminates the current user's session,
135
+ * debugs the request and reset's the internal
136
+ * debudder.
137
+ *
138
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
139
+ */
140
+ public function logout()
141
+ {
142
+ if (!$this->checkSession()) return false;
143
+ $res=$this->get("http://kids.co.uk/email/dologout.php",true);
144
+ $this->debugRequest();
145
+ $this->resetDebugger();
146
+ $this->stopPlugin();
147
+ return true;
148
+ }
149
+ }
150
+
151
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/kincafe.plg.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Created on Feb 10, 2009 by Vlad
4
+ */
5
+
6
+ $_pluginInfo=array(
7
+ 'name'=>'Kincafe',
8
+ 'version'=>'1.0.3',
9
+ 'description'=>"Get the contacts from a kincafe.com account",
10
+ 'base_version'=>'1.6.7',
11
+ 'type'=>'social',
12
+ 'check_url'=>'http://www.kincafe.com/',
13
+ 'requirement'=>'email',
14
+ 'allowed_domains'=>false,
15
+ 'imported_details'=>array('first_name','email_1'),
16
+ );
17
+
18
+ /**
19
+ * kincafe Plugin
20
+ *
21
+ * Import user's contacts from kincafe
22
+ *
23
+ * @author OpenInviter
24
+ * @version 1.0.1
25
+ */
26
+ class kincafe extends openinviter_base
27
+ {
28
+ private $login_ok=false;
29
+ public $showContacts=true;
30
+ public $internalError=false;
31
+ protected $timeout=30;
32
+
33
+ public $debug_array=array(
34
+ 'login_post'=>'logout.fam',
35
+ );
36
+
37
+ /**
38
+ * Login function
39
+ *
40
+ * Makes all the necessary requests to authenticate
41
+ * the current user to the server.
42
+ *
43
+ * @param string $user The current user.
44
+ * @param string $pass The password for the current user.
45
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
46
+ */
47
+ public function login($user,$pass)
48
+ {
49
+ $this->resetDebugger();
50
+ $this->service='kincafe';
51
+ $this->service_user=$user;
52
+ $this->service_password=$pass;
53
+
54
+ if (!$this->init()) return false;
55
+
56
+ $res = $this->get('http://www.kincafe.com/signin.fam',true);
57
+ $post_elements = $this->getHiddenElements($res);
58
+ $post_elements['loginForm:username']=$user;
59
+ $post_elements['loginForm:pwd']=$pass;
60
+ $post_elements['loginForm:bottomSignInBtn']='+Sign+In+';
61
+ $res = $this->post("http://www.kincafe.com/signin.fam",$post_elements,true);
62
+ if ($this->checkResponse("login_post",$res))
63
+ $this->updateDebugBuffer('login_post',"http://www.kincafe.com/signin.fam",'POST');
64
+ else
65
+ {
66
+ $this->updateDebugBuffer('login_post',"http://www.kincafe.com/signin.fam",'POST',false);
67
+ $this->debugRequest();
68
+ $this->stopPlugin();
69
+ return false;
70
+ }
71
+ $this->login_ok = "http://www.kincafe.com/fammemlist.fam";
72
+ return true;
73
+ }
74
+
75
+ /**
76
+ * Get the current user's contacts
77
+ *
78
+ * Makes all the necesarry requests to import
79
+ * the current user's contacts
80
+ *
81
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
82
+ */
83
+ public function getMyContacts()
84
+ {
85
+ if (!$this->login_ok)
86
+ {
87
+ $this->debugRequest();
88
+ $this->stopPlugin();
89
+ return false;
90
+ }
91
+ else $url=$this->login_ok;
92
+ $res = $this->get($url,true);
93
+ //echo $res;
94
+ $contacts=array();
95
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
96
+ $xpath=new DOMXPath($doc);$query="//tr[@style='background-color:#fbfbfb']";$data=$xpath->query($query);
97
+ foreach($data as $node)
98
+ {
99
+ $td=$node->childNodes;
100
+ $name = $td->item(2)->nodeValue;
101
+ $email = $td->item(6)->nodeValue;
102
+ $contacts[$email]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$email);
103
+ }
104
+ return $this->returnContacts($contacts);
105
+ }
106
+
107
+ /**
108
+ * Terminate session
109
+ *
110
+ * Terminates the current user's session,
111
+ * debugs the request and reset's the internal
112
+ * debudder.
113
+ *
114
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
115
+ */
116
+ public function logout()
117
+ {
118
+ if (!$this->checkSession()) return false;
119
+ $res=$this->get("http://www.kincafe.com/logout.fam");
120
+ $this->debugRequest();
121
+ $this->resetDebugger();
122
+ $this->stopPlugin();
123
+ return true;
124
+ }
125
+ }
126
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/konnects.plg.php ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Konnects
3
+ * You can Write Private Messages using Konnects system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Konnects',
7
+ 'version'=>'1.0.5',
8
+ 'description'=>"Get the contacts from a Konnects account",
9
+ 'base_version'=>'1.6.7',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.konnects.com/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Konnects Plugin
17
+ *
18
+ * Import Friends from Konnects
19
+ * You can Write Private Messages using Konnects system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class konnects extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'UserName',
33
+ 'login_post'=>'fncRedirect',
34
+ 'get_friends'=>'links_inbox',
35
+ 'url_friend'=>'a',
36
+ 'url_send_message'=>'a',
37
+ 'send_message'=>'sent'
38
+ );
39
+
40
+ /**
41
+ * Login function
42
+ *
43
+ * Makes all the necessary requests to authenticate
44
+ * the current user to the server.
45
+ *
46
+ * @param string $user The current user.
47
+ * @param string $pass The password for the current user.
48
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
49
+ */
50
+ public function login($user,$pass)
51
+ {
52
+ $this->resetDebugger();
53
+ $this->service='konnects';
54
+ $this->service_user=$user;
55
+ $this->service_password=$pass;
56
+ if (!$this->init()) return false;
57
+
58
+ $res=$this->get("http://www.konnects.com/",true);
59
+ if ($this->checkResponse("initial_get",$res))
60
+ $this->updateDebugBuffer('initial_get',"http://www.konnects.com/",'GET');
61
+ else
62
+ {
63
+ $this->updateDebugBuffer('initial_get',"http://www.konnects.com/",'GET',false);
64
+ $this->debugRequest();
65
+ $this->stopPlugin();
66
+ return false;
67
+ }
68
+
69
+ $form_action="https://www.konnects.com/login.jsp?Flag=R";
70
+ $post_elements=array('Return'=>'member_homepage.jspf',
71
+ 'UserName'=>$user,
72
+ 'Password'=>$pass
73
+ );
74
+ $res=$this->post($form_action,$post_elements,true);
75
+ if ($this->checkResponse("login_post",$res))
76
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
77
+ else
78
+ {
79
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
80
+ $this->debugRequest();
81
+ $this->stopPlugin();
82
+ return false;
83
+ }
84
+ $url_friends='http://www.konnects.com/member_connections.jsp';
85
+ $this->login_ok=$url_friends;
86
+ return true;
87
+ }
88
+
89
+ /**
90
+ * Get the current user's contacts
91
+ *
92
+ * Makes all the necesarry requests to import
93
+ * the current user's contacts
94
+ *
95
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
96
+ */
97
+ public function getMyContacts()
98
+ {
99
+ if (!$this->login_ok)
100
+ {
101
+ $this->debugRequest();
102
+ $this->stopPlugin();
103
+ return false;
104
+ }
105
+ else $url=$this->login_ok;
106
+ $res=$this->get($url);
107
+ if ($this->checkResponse("get_friends",$res))
108
+ $this->updateDebugBuffer('get_friends',$url,'GET');
109
+ else
110
+ {
111
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
112
+ $this->debugRequest();
113
+ $this->stopPlugin();
114
+ return false;
115
+ }
116
+
117
+ $contacts=array();
118
+ $names_array=$this->getElementDOM($res,"//a[@class='links_inbox']");
119
+ $hrefs_array=$this->getElementDOM($res,"//a[@class='links_inbox']",'href');
120
+ if (!empty($hrefs_array))
121
+ foreach($hrefs_array as $key=>$value) $contacts[$value]=(!empty($names_array[$key])?$names_array[$key]:false);
122
+ return $contacts;
123
+ }
124
+
125
+ /**
126
+ * Send message to contacts
127
+ *
128
+ * Sends a message to the contacts using
129
+ * the service's inernal messaging system
130
+ *
131
+ * @param string $cookie_file The location of the cookies file for the current session
132
+ * @param string $message The message being sent to your contacts
133
+ * @param array $contacts An array of the contacts that will receive the message
134
+ * @return mixed FALSE on failure.
135
+ */
136
+ public function sendMessage($session_id,$message,$contacts)
137
+ {
138
+ $countMessages=0;
139
+ foreach($contacts as $href=>$name)
140
+ {
141
+ $countMessages++;
142
+ $url_friend='http://www.konnects.com/'.$href;
143
+ $res=$this->get($url_friend,true);
144
+ if ($this->checkResponse("url_friend",$res))
145
+ $this->updateDebugBuffer('url_friend',$url_friend,'GET');
146
+ else
147
+ {
148
+ $this->updateDebugBuffer('url_friend',$url_friend,'GET',false);
149
+ $this->debugRequest();
150
+ $this->stopPlugin();
151
+ return false;
152
+ }
153
+
154
+ $url_send_message="http://www.konnects.com/profiles_message".$this->getElementString($res,'profiles_message','"');
155
+ $res=$this->get($url_send_message,true);
156
+ if ($this->checkResponse("url_send_message",$res))
157
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET');
158
+ else
159
+ {
160
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET',false);
161
+ $this->debugRequest();
162
+ $this->stopPlugin();
163
+ return false;
164
+ }
165
+
166
+ $form_action='http://www.konnects.com/'.$this->getElementString($res,'name="profile" id="profile" action="','"');
167
+ $post_elements=$this->getHiddenElements($res);$post_elements['Message']=$message['body'];
168
+ $res=$this->post($form_action,$post_elements,true);
169
+ if ($this->checkResponse("send_message",$res))
170
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
171
+ else
172
+ {
173
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
174
+ $this->debugRequest();
175
+ $this->stopPlugin();
176
+ return false;
177
+ }
178
+ sleep($this->messageDelay);
179
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
180
+ }
181
+
182
+ }
183
+
184
+ /**
185
+ * Terminate session
186
+ *
187
+ * Terminates the current user's session,
188
+ * debugs the request and reset's the internal
189
+ * debudder.
190
+ *
191
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
192
+ */
193
+ public function logout()
194
+ {
195
+ if (!$this->checkSession()) return false;
196
+ $res=$this->get("http://www.konnects.com/logout.jsp");
197
+ $this->debugRequest();
198
+ $this->resetDebugger();
199
+ $this->stopPlugin();
200
+ return true;
201
+ }
202
+ }
203
+
204
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/koolro.plg.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Koolro
3
+ * You can send message to your Friends Inbox
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Koolro',
7
+ 'version'=>'1.0.1',
8
+ 'description'=>"Get the contacts from a Koolro account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.koolro.com/',
12
+ 'requirement'=>'user',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Koolro Plugin
17
+ *
18
+ * Imports user's contacts from Koolro and sends
19
+ * messages using Koolro's internal system.
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.8
23
+ */
24
+ class koolro extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'username',
33
+ 'login_post'=>'contacts.contacts',
34
+ 'url_friends'=>'option',
35
+ 'send_message'=>'ajFetch'
36
+ );
37
+
38
+ /**
39
+ * Login function
40
+ *
41
+ * Makes all the necessary requests to authenticate
42
+ * the current user to the server.
43
+ *
44
+ * @param string $user The current user.
45
+ * @param string $pass The password for the current user.
46
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
47
+ */
48
+ public function login($user,$pass)
49
+ {
50
+ $this->resetDebugger();
51
+ $this->service='koolro';
52
+ $this->service_user=$user;
53
+ $this->service_password=$pass;
54
+ if (!$this->init()) return false;
55
+
56
+ $res=$this->get("http://www.koolro.com/",true);
57
+ if ($this->checkResponse("initial_get",$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.koolro.com/",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.koolro.com/",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+
67
+ $form_action="http://www.koolro.com/index.php?L";
68
+ $post_elements=array('username'=>$user,'password'=>$pass,'userlogin'=>false);
69
+ $res=$this->post($form_action,$post_elements,true);
70
+ if ($this->checkResponse("login_post",$res))
71
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
72
+ else
73
+ {
74
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
75
+ $this->debugRequest();
76
+ $this->stopPlugin();
77
+ return false;
78
+ }
79
+
80
+
81
+ $url_my_friends='http://www.koolro.com/index.php?L=mails.write';
82
+ $this->login_ok=$url_my_friends;
83
+ return true;
84
+ }
85
+
86
+ /**
87
+ * Get the current user's contacts
88
+ *
89
+ * Makes all the necesarry requests to import
90
+ * the current user's contacts
91
+ *
92
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
93
+ */
94
+ public function getMyContacts()
95
+ {
96
+ if (!$this->login_ok)
97
+ {
98
+ $this->debugRequest();
99
+ $this->stopPlugin();
100
+ return false;
101
+ }
102
+ else $url=$this->login_ok;
103
+ $res=$this->get($url,true);
104
+ if ($this->checkResponse("url_friends",$res))
105
+ $this->updateDebugBuffer('url_friends',$url,'GET');
106
+ else
107
+ {
108
+ $this->updateDebugBuffer('url_friends',$url,'GET',false);
109
+ $this->debugRequest();
110
+ $this->stopPlugin();
111
+ return false;
112
+ }
113
+
114
+ $contacts=array();
115
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
116
+ $xpath=new DOMXPath($doc);$query="//option";$data=$xpath->query($query);
117
+ foreach($data as $node)
118
+ { $value=$node->getAttribute('value');if(!empty($value)) $contacts[$value]=$value; }
119
+ return $contacts;
120
+ }
121
+
122
+ /**
123
+ * Send message to contacts
124
+ *
125
+ * Sends a message to the contacts using
126
+ * the service's inernal messaging system
127
+ *
128
+ * @param string $session_id The OpenInviter user's session ID
129
+ * @param string $message The message being sent to your contacts
130
+ * @param array $contacts An array of the contacts that will receive the message
131
+ * @return mixed FALSE on failure.
132
+ */
133
+ public function sendMessage($session_id,$message,$contacts)
134
+ {
135
+ $countMessages=0;
136
+ foreach ($contacts as $name)
137
+ {
138
+ $countMessages++;
139
+ $form_action="http://www.koolro.com/index.php?L=mails.write";
140
+ $post_elements=array('subject'=>$message['subject'],
141
+ 'body'=>$message['body'],
142
+ 'username'=>false,
143
+ 'contact'=>$name,
144
+ 'Submit'=>'Submit'
145
+ );
146
+ $res=$this->post($form_action,$post_elements,true);
147
+ if ($this->checkResponse("send_message",$res))
148
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
149
+ else
150
+ {
151
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
152
+ $this->debugRequest();
153
+ $this->stopPlugin();
154
+ return false;
155
+ }
156
+ sleep($this->messageDelay);
157
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
158
+ }
159
+ }
160
+
161
+ /**
162
+ * Terminate session
163
+ *
164
+ * Terminates the current user's session,
165
+ * debugs the request and reset's the internal
166
+ * debudder.
167
+ *
168
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
169
+ */
170
+ public function logout()
171
+ {
172
+ if (!$this->checkSession()) return false;
173
+ $res=$this->get("http://www.koolro.com/index.php?logout",true);
174
+ $this->debugRequest();
175
+ $this->resetDebugger();
176
+ $this->stopPlugin();
177
+ return true;
178
+ }
179
+ }
180
+
181
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/lastfm.plg.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Last.fm',
4
+ 'version'=>'1.0.5',
5
+ 'description'=>"Get the contacts from a Last.fm account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'social',
8
+ 'check_url'=>'http://www.last.fm',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * LastFm Plugin
14
+ *
15
+ * Import user's contacts from Last.fm AddressBook
16
+ *
17
+ * @author OpenInviter
18
+ * @version 1.0.0
19
+ */
20
+ class lastfm extends openinviter_base
21
+ {
22
+ private $login_ok=false;
23
+ public $showContacts=true;
24
+ private $sess_id, $username, $siteAddr;
25
+
26
+ public $debug_array=array(
27
+ 'login_post'=>'logout',
28
+ 'friends_url'=>'username'
29
+ );
30
+
31
+ /**
32
+ * Login function
33
+ *
34
+ * Makes all the necessary requests to authenticate
35
+ * the current user to the server.
36
+ *
37
+ * @param string $user The current user.
38
+ * @param string $pass The password for the current user.
39
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
40
+ */
41
+ public function login($user,$pass)
42
+ {
43
+ $this->resetDebugger();
44
+ $this->service='lastfm';
45
+ $this->service_user=$user;
46
+ $this->service_password=$pass;
47
+ if (!$this->init()) return false;
48
+ $post_elements=array("username"=>"{$user}",
49
+ "password"=>"{$pass}",
50
+ "backto"=>urldecode("http%3A%2F%2Fwww.last.fm%2Flogin%2FsuccessCallback"));
51
+ $res=$this->post("https://www.last.fm/login?lang=&withsid",$post_elements,true);
52
+ if ($this->checkResponse("login_post",$res))
53
+ $this->updateDebugBuffer('login_post',"https://www.last.fm/login?lang=&withsid",'POST');
54
+ else
55
+ {
56
+ $this->updateDebugBuffer('login_post',"https://www.last.fm/login?lang=&withsid",'POST',false);
57
+ $this->debugRequest();
58
+ $this->stopPlugin();
59
+ return false;
60
+ }
61
+ $this->login_ok = "http://www.last.fm/inbox/compose";
62
+ return true;
63
+ }
64
+
65
+ /**
66
+ * Get the current user's contacts
67
+ *
68
+ * Makes all the necesarry requests to import
69
+ * the current user's contacts
70
+ *
71
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
72
+ */
73
+ public function getMyContacts()
74
+ {
75
+ if (!$this->login_ok)
76
+ {
77
+ $this->debugRequest();
78
+ $this->stopPlugin();
79
+ return false;
80
+ }
81
+ else $url=$this->login_ok;
82
+ $res=$this->get($url,true);
83
+ $contacts=array();
84
+ if (preg_match_all("#\"r4\_(.+)\"\:\{\"username\"\:\"(.+)\"#U",$res,$matches))
85
+ {
86
+ if (!empty($matches[1]))
87
+ foreach($matches[1] as $key=>$id)
88
+ if (!empty($matches[2][$key])) $contacts["r4_{$id}"]=$matches[2][$key];
89
+ }
90
+ return $contacts;
91
+ }
92
+
93
+ /**
94
+ * Send message to contacts
95
+ *
96
+ * Sends a message to the contacts using
97
+ * the service's inernal messaging system
98
+ *
99
+ * @param string $cookie_file The location of the cookies file for the current session
100
+ * @param string $message The message being sent to your contacts
101
+ * @param array $contacts An array of the contacts that will receive the message
102
+ * @return mixed FALSE on failure.
103
+ */
104
+ public function sendMessage($session_id,$message,$contacts)
105
+ {
106
+ $res = $this->get("http://www.last.fm/inbox/compose");
107
+ $postelem = $this->getHiddenElements($res);
108
+ $postelem['to']="";
109
+ $postelem['subject']=$message['subject'];
110
+ $postelem['body']=$message['body'];
111
+ $countMessages=0;
112
+ foreach ($contacts as $id => $username)
113
+ {
114
+ $countMessages++;
115
+ $postelem['to_ids%5B%5D'] = $id;
116
+ $res = $this->post('http://www.last.fm/inbox/compose',$postelem, true, true);
117
+ sleep($this->messageDelay);
118
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
119
+ }
120
+ }
121
+
122
+ /**
123
+ * Terminate session
124
+ *
125
+ * Terminates the current user's session,
126
+ * debugs the request and reset's the internal
127
+ * debudder.
128
+ *
129
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
130
+ */
131
+ public function logout()
132
+ {
133
+ if (!$this->checkSession()) return false;
134
+ $logout_url = "http://www.last.fm/login/logout";
135
+ $res = $this->get($logout_url);
136
+ $this->debugRequest();
137
+ $this->resetDebugger();
138
+ $this->stopPlugin();
139
+ return true;
140
+ }
141
+ }
142
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/libero.plg.php ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Libero',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Libero account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://imodemail.libero.it/imodeaccess/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(libero.it)/i','/(inwind.it)/i','/(iol.it)/i','/(blu.it)/i'),
11
+ 'imported_details'=>array('first_name','last_name','nickname','email_1'),
12
+ );
13
+ /**
14
+ * Libero Plugin
15
+ *
16
+ * Imports user's contacts from Libero's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.2
20
+ */
21
+ class libero extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+ public $debug_array=array('initial_get'=>'password',
28
+ 'post_login'=>'Location:',
29
+ 'inbox'=>'accesskey="4"',
30
+ 'contacts_page'=>'accesskey="1"',
31
+ 'contact_info'=>'Addr_ln',
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user, $pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='libero';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("http://imodemail.libero.it/imodeaccess/",true);
53
+ if ($this->checkResponse('initial_get',$res))
54
+ $this->updateDebugBuffer('initial_get',"http://imodemail.libero.it/imodeaccess/",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"http://imodemail.libero.it/imodeaccess/",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+ $form_action="http://imodemail.libero.it/imodemail/servlets/CliLoginImode?Act=enter";
63
+ $domain_array=explode("@",$user);$domain=$domain_array[1];$libero_user=$domain_array[0];
64
+ $post_elements=array(
65
+ "u"=>$libero_user,
66
+ "d"=>$domain,
67
+ "p"=>$pass,
68
+ ''=>'Entra'
69
+ );
70
+ $res=$this->post($form_action,$post_elements,false,true,false,array(),false,false);
71
+ if ($this->checkResponse('post_login',$res))
72
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',true,$post_elements);
73
+ else
74
+ {
75
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',false,$post_elements);
76
+ $this->debugRequest();
77
+ $this->stopPlugin();
78
+ return false;
79
+ }
80
+
81
+ $base_url="http://".$this->getElementString($this->getElementString($res,"Location: ",PHP_EOL),"http://",'/');
82
+ $url_redirect=str_replace(" [following]","",$this->getElementString($res,"Location: ",PHP_EOL));
83
+ $res=$this->get($url_redirect,true);
84
+ if ($this->checkResponse('inbox',$res))
85
+ $this->updateDebugBuffer('inbox',$url_redirect,'GET');
86
+ else
87
+ {
88
+ $this->updateDebugBuffer('inbox',$url_redirect,'GET',false);
89
+ $this->debugRequest();
90
+ $this->stopPlugin();
91
+ return false;
92
+ }
93
+ $url_contacts_array=$this->getElementDOM($res,"//a[@accesskey='4']",'href');
94
+ $url_contacts=array();$url_contacts=array($base_url,$url_contacts_array[0]);
95
+ $this->login_ok=$url_contacts;
96
+ file_put_contents($this->getLogoutPath(),$url_redirect);
97
+ return true;
98
+ }
99
+
100
+ /**
101
+ * Get the current user's contacts
102
+ *
103
+ * Makes all the necesarry requests to import
104
+ * the current user's contacts
105
+ *
106
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
107
+ */
108
+ public function getMyContacts()
109
+ {
110
+ if (!$this->login_ok)
111
+ {
112
+ $this->debugRequest();
113
+ $this->stopPlugin();
114
+ return false;
115
+ }
116
+ else $url=$this->login_ok;
117
+
118
+ $res=$this->get($url[0].$url[1]);
119
+ if ($this->checkResponse('contacts_page',$res))
120
+ $this->updateDebugBuffer('contacts_page',$url[0].$url[1],'GET');
121
+ else
122
+ {
123
+ $this->updateDebugBuffer('contacts_page',$url[0].$url[1],'GET',false);
124
+ $this->debugRequest();
125
+ $this->stopPlugin();
126
+ return false;
127
+ }
128
+
129
+ $contacts=array();$next=true;
130
+ while($next)
131
+ {
132
+ $url_next_array=$this->getElementDOM($res,"//a[@accesskey='1']",'href');
133
+ $url_next=$url[0].$url_next_array[0];
134
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
135
+ $xpath=new DOMXPath($doc);$query="//a";$data=$xpath->query($query);
136
+ foreach($data as $node)
137
+ {
138
+ if (strpos($node->getAttribute('href'),'Act_Role=0')!==false)
139
+ {
140
+ $url_contact=$url[0].$node->getAttribute('href');
141
+ $res=$this->get($url_contact,true);
142
+ if ($this->checkResponse('contact_info',$res))
143
+ $this->updateDebugBuffer('contact_info',$url_contact,'GET');
144
+ else
145
+ {
146
+ $this->updateDebugBuffer('contact_info',$url_contact,'GET',false);
147
+ $this->debugRequest();
148
+ $this->stopPlugin();
149
+ return false;
150
+ }
151
+
152
+ $cognome=$this->getElementString($res,'name="Addr_ln" value="','"');
153
+ $nome=$this->getElementString($res,'name="Addr_fn" value="','"');
154
+ $alias=$this->getElementString($res,'name="Addr_alias" value="','"');
155
+ $email=$this->getElementString($res,'Addr_mail" value="','"');
156
+ if (!empty($email)) $contacts[$email]=array('first_name'=>$nome,'last_name'=>$cognome,'nickname'=>$alias,'email_1'=>$email);
157
+ }
158
+ }
159
+ if (!empty($url_next_array[0])) $res=$this->get($url_next,true);
160
+ else $next=false;
161
+ }
162
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
163
+ return $this->returnContacts($contacts);
164
+ }
165
+
166
+ /**
167
+ * Terminate session
168
+ *
169
+ * Terminates the current user's session,
170
+ * debugs the request and reset's the internal
171
+ * debudder.
172
+ *
173
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
174
+ */
175
+ public function logout()
176
+ {
177
+ if (!$this->checkSession()) return false;
178
+ if (file_exists($this->getLogoutPath()))
179
+ {
180
+ $url=file_get_contents($this->getLogoutPath());
181
+ $res=$this->get($url,true);
182
+ $url_logout=$this->getElementDOM($res,"//a[@accesskey='8']",'href');
183
+ $base_url="http://".$this->getElementString($url,"http://",'/');
184
+ $res=$this->get($base_url.$url_logout[0]);
185
+ $res=$this->get("http://portal.imode.wind.it/gprs/mn/main.htm",true);
186
+ }
187
+ $this->debugRequest();
188
+ $this->resetDebugger();
189
+ $this->stopPlugin();
190
+ }
191
+ }
192
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/linkedin.plg.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'LinkedIn',
4
+ 'version'=>'1.1.2',
5
+ 'description'=>"Get the contacts from a LinkedIn account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.linkedin.com',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * LinkedIn
14
+ *
15
+ * Imports user's email contacts from LinkedIn
16
+ *
17
+ * @author OpenInviter
18
+ * @version 1.1.1
19
+ */
20
+ class linkedin extends openinviter_base
21
+ {
22
+ private $login_ok=false;
23
+ public $showContacts=true;
24
+ public $internalError=false;
25
+ protected $timeout=30;
26
+
27
+ public $debug_array=array(
28
+ 'initial_get'=>'session_password',
29
+ 'login_post'=>'window.location.replace',
30
+ 'js_page'=>'csrfToken',
31
+ 'get_friends'=>'emailAddress',
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user,$pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='linkedin';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("https://www.linkedin.com/secure/login?trk=hb_signin");
53
+ if ($this->checkResponse("initial_get",$res))
54
+ $this->updateDebugBuffer('initial_get',"https://www.linkedin.com/secure/login?trk=hb_signin",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"https://www.linkedin.com/secure/login?trk=hb_signin",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+ $form_action="https://www.linkedin.com/secure/login";
63
+ $post_elements=array('csrfToken'=>'guest_token',
64
+ 'session_key'=>$user,
65
+ 'session_password'=>$pass,
66
+ 'session_login'=>'Sign In',
67
+ 'session_login'=>'',
68
+ 'session_rikey'=>''
69
+ );
70
+ $res=$this->post($form_action,$post_elements,true);
71
+ if ($this->checkResponse("login_post",$res))
72
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
73
+ else
74
+ {
75
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
76
+ $this->debugRequest();
77
+ $this->stopPlugin();
78
+ return false;
79
+ }
80
+
81
+ $res=$this->get("http://www.linkedin.com/home",true);
82
+ if ($this->checkResponse("js_page",$res))
83
+ $this->updateDebugBuffer('js_page',"https://www.linkedin.com/secure/login?trk=hb_signin",'GET');
84
+ else
85
+ {
86
+ $this->updateDebugBuffer('js_page',"https://www.linkedin.com/secure/login?trk=hb_signin",'GET',false);
87
+ $this->debugRequest();
88
+ $this->stopPlugin();
89
+ return false;
90
+ }
91
+ $this->ajaxSes=$this->getElementString($res,'name="csrfToken" value="','"');
92
+ $url_friends="http://www.linkedin.com/dwr/exec/ConnectionsBrowserService.getMyConnections.dwr";
93
+ $this->login_ok=$url_friends;
94
+ return true;
95
+ }
96
+
97
+ /**
98
+ * Get the current user's contacts
99
+ *
100
+ * Makes all the necesarry requests to import
101
+ * the current user's contacts
102
+ *
103
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
104
+ */
105
+ public function getMyContacts()
106
+ {
107
+ if (!$this->login_ok)
108
+ {
109
+ $this->debugRequest();
110
+ $this->stopPlugin();
111
+ return false;
112
+ }
113
+ else $form_action=$this->login_ok;
114
+ $post_elements=array('callCount'=>'1',
115
+ 'JSESSIONID'=>$this->ajaxSes,
116
+ 'c0-scriptName'=>'ConnectionsBrowserService',
117
+ 'c0-methodName'=>'getMyConnections',
118
+ 'c0-param0'=>'string:0',
119
+ 'c0-param1'=>'number:-1',
120
+ 'c0-param2'=>'string:DONT_CARE',
121
+ 'c0-param3'=>'number:10000',
122
+ 'c0-param4'=>'boolean:false',
123
+ 'c0-param5'=>'boolean:true',
124
+ 'xml'=>'true',
125
+ );
126
+ $headers = array('Content-Type'=>'text/plain');
127
+ $res=$this->post($form_action,$post_elements,false,false,false,$headers);
128
+ if ($this->checkResponse("get_friends",$res))
129
+ $this->updateDebugBuffer('get_friends',"{$form_action}",'POST',true,$post_elements);
130
+ else
131
+ {
132
+ $this->updateDebugBuffer('get_friends',"{$form_action}",'POST',false,$post_elements);
133
+ $this->debugRequest();
134
+ $this->stopPlugin();
135
+ return false;
136
+ }
137
+
138
+ $cr = "/var s\\d+=\\{\\};(.*?)\\.profileLink=/ims";
139
+ $fr = "/var s\\d+=\"([^\"]*)\";s\\d+.firstName=s\\d+/ims";
140
+ $er = "/var s\\d+=\"([^\"]*)\";s\\d+.emailAddress=s\\d+/ims";
141
+ $lr = "/var s\\d+=\"([^\"]*)\";s\\d+.lastName=s\\d+/ims";
142
+ $ar = "/var s\\d+=\"([A-Z#])\";s\\d+\\[\\d+\\]=s\\d+;/ims";
143
+ $dr = "/;s\\d+\\['([A-Z#])'\\]=s\\d+;/ims";
144
+ preg_match_all($cr, $res, $found, PREG_SET_ORDER);
145
+ foreach ($found as $val)
146
+ { $tempHtml= $val[0];if (preg_match($er,$tempHtml,$foundEmails)) { $email=$foundEmails[1];if ($this->isEmail($email)) { $first_name=preg_match($fr,$tempHtml,$foundEmails) ? $foundEmails[1] : ''; $last_name=preg_match($lr,$tempHtml,$foundEmails) ? $foundEmails[1] : '';$last_name;$contacts[$email]=array('first_name'=>isset($first_name)?$first_name:false,'last_name'=>isset($last_name)?$last_name:false,'email_1'=>$email); } } }
147
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
148
+ return $this->returnContacts($contacts);
149
+ }
150
+
151
+ /**
152
+ * Terminate session
153
+ *
154
+ * Terminates the current user's session,
155
+ * debugs the request and reset's the internal
156
+ * debudder.
157
+ *
158
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
159
+ */
160
+ public function logout()
161
+ {
162
+ if (!$this->checkSession()) return false;
163
+ $res=$this->get("https://www.linkedin.com/secure/login?session_full_logout=&trk=hb_signout",true);
164
+ $this->debugRequest();
165
+ $this->resetDebugger();
166
+ $this->stopPlugin();
167
+ return true;
168
+ }
169
+ }
170
+
171
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/livejournal.plg.php ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Livejournal
3
+ * You can Post Messages using Livejournal system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Livejournal',
7
+ 'version'=>'1.0.5',
8
+ 'description'=>"Get the contacts from a Livejournal account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.livejournal.com/mobile/',
12
+ 'requirement'=>'user',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Livejournal Plugin
17
+ *
18
+ * Import user's contacts from Livejournal and Post messages
19
+ * using Livejournal's internal Posting system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class livejournal extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'user',
33
+ 'login_post'=>'post.bml',
34
+ 'get_friends'=>'lj:user',
35
+ 'url_send_message'=>'lj_form_auth',
36
+ 'send_message'=>'successfully'
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='livejuornal';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("http://www.livejournal.com/mobile/login.bml");
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"http://www.livejournal.com/mobile/login.bml",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"http://www.livejournal.com/mobile/login.bml",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+
68
+ $form_action="http://www.livejournal.com/mobile/login.bml";
69
+ $post_elements=array('user'=>$user,'password'=>$pass);
70
+ $res=$this->post($form_action,$post_elements,true);
71
+ if ($this->checkResponse("login_post",$res))
72
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
73
+ else
74
+ {
75
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
76
+ $this->debugRequest();
77
+ $this->stopPlugin();
78
+ return false;
79
+ }
80
+ $url_post='http://www.livejournal.com/friends/edit.bml';
81
+ $this->login_ok=$url_post;
82
+ return true;
83
+ }
84
+
85
+ /**
86
+ * Get the current user's contacts
87
+ *
88
+ * Makes all the necesarry requests to import
89
+ * the current user's contacts
90
+ *
91
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
92
+ */
93
+ public function getMyContacts()
94
+ {
95
+ if (!$this->login_ok)
96
+ {
97
+ $this->debugRequest();
98
+ $this->stopPlugin();
99
+ return false;
100
+ }
101
+ else $url=$this->login_ok;
102
+ $res=$this->get($url,true);
103
+ if ($this->checkResponse("get_friends",$res))
104
+ $this->updateDebugBuffer('get_friends',$url,'GET');
105
+ else
106
+ {
107
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
108
+ $this->debugRequest();
109
+ $this->stopPlugin();
110
+ return false;
111
+ }
112
+
113
+ $contacts=array();
114
+ $contacts_array=$this->getElementDOM($res,"//span[@class='ljuser']");
115
+ if (!empty($contacts_array))
116
+ foreach($contacts_array as $name) if (!empty($name)) $contacts[$name]=!empty($name)?$name:false;
117
+ unset($contacts['lj_maintenance']);unset($contacts['lj_spotlight']);unset($contacts['news']);
118
+ if (isset($contacts[$this->service_user])) unset($contacts[$this->service_user]);
119
+ return $contacts;
120
+ }
121
+
122
+ /**
123
+ * Send message to contacts
124
+ *
125
+ * Sends a message to the contacts using
126
+ * the service's inernal messaging system
127
+ *
128
+ * @param string $cookie_file The location of the cookies file for the current session
129
+ * @param string $message The message being sent to your contacts
130
+ * @param array $contacts An array of the contacts that will receive the message
131
+ * @return mixed FALSE on failure.
132
+ */
133
+ public function sendMessage($session_id,$message,$contacts)
134
+ {
135
+ $countMessages=0;
136
+ foreach($contacts as $name)
137
+ {
138
+ $countMessages++;
139
+ $form_action='http://www.livejournal.com/inbox/compose.bml';
140
+ $res=$this->get($form_action);
141
+ if ($this->checkResponse("url_send_message",$res))
142
+ $this->updateDebugBuffer('url_send_message',$form_action,'GET');
143
+ else
144
+ {
145
+ $this->updateDebugBuffer('url_send_message',$form_action,'GET',false);
146
+ $this->debugRequest();
147
+ $this->stopPlugin();
148
+ return false;
149
+ }
150
+
151
+ $post_elements=array('lj_form_auth'=>$this->getElementString($res,'name="lj_form_auth" value="','"'),
152
+ 'msg_to'=>$name,
153
+ 'msg_subject'=>$message['subject'],
154
+ 'msg_body'=>$message['body'],
155
+ 'mode'=>'send',
156
+ );
157
+ $res=$this->post($form_action,$post_elements,true);
158
+ if ($this->checkResponse("send_message",$res))
159
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
160
+ else
161
+ {
162
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
163
+ $this->debugRequest();
164
+ $this->stopPlugin();
165
+ return false;
166
+ }
167
+ sleep($this->messageDelay);
168
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
169
+ }
170
+
171
+ }
172
+
173
+ /**
174
+ * Terminate session
175
+ *
176
+ * Terminates the current user's session,
177
+ * debugs the request and reset's the internal
178
+ * debudder.
179
+ *
180
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
181
+ */
182
+ public function logout()
183
+ {
184
+ if (!$this->checkSession()) return false;
185
+ $res=$this->get("http://www.livejournal.com/logout.bml");
186
+ $this->debugRequest();
187
+ $this->resetDebugger();
188
+ $this->stopPlugin();
189
+ return true;
190
+ }
191
+ }
192
+
193
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/lovento.plg.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Lovento
3
+ * You can Write Private Messages using Lovento system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Lovento',
7
+ 'version'=>'1.0.3',
8
+ 'description'=>"Get the contacts from a Lovento account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.lovento.com/',
12
+ 'requirement'=>'user',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Lovento Plugin
17
+ *
18
+ * Import Friends from Lovento
19
+ * You can Write Private Messages using Lovento system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class lovento extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'login',
33
+ 'login_post'=>'logout',
34
+ 'get_friends'=>'to_id',
35
+ 'send_message'=>'Inbox'
36
+ );
37
+
38
+ /**
39
+ * Login function
40
+ *
41
+ * Makes all the necessary requests to authenticate
42
+ * the current user to the server.
43
+ *
44
+ * @param string $user The current user.
45
+ * @param string $pass The password for the current user.
46
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
47
+ */
48
+ public function login($user,$pass)
49
+ {
50
+ $this->resetDebugger();
51
+ $this->service='lovento';
52
+ $this->service_user=$user;
53
+ $this->service_password=$pass;
54
+ if (!$this->init()) return false;
55
+
56
+ $res=$this->get("http://www.lovento.com/en/",true);
57
+ if ($this->checkResponse("initial_get",$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.lovento.com/en/",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.lovento.com/en/",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+
67
+ $form_action="http://www.lovento.com/en/check_login/";
68
+ $post_elements=array('login'=>$user,
69
+ 'password'=>$pass,
70
+ );
71
+ $res=$this->post($form_action,$post_elements,true);
72
+ if ($this->checkResponse("login_post",$res))
73
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
74
+ else
75
+ {
76
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
77
+ $this->debugRequest();
78
+ $this->stopPlugin();
79
+ return false;
80
+ }
81
+ $url_friends='http://www.lovento.com/en/ajax/message_center_write_mail/?to_id=';
82
+ $this->login_ok=$url_friends;
83
+ return true;
84
+ }
85
+
86
+ /**
87
+ * Get the current user's contacts
88
+ *
89
+ * Makes all the necesarry requests to import
90
+ * the current user's contacts
91
+ *
92
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
93
+ */
94
+ public function getMyContacts()
95
+ {
96
+ if (!$this->login_ok)
97
+ {
98
+ $this->debugRequest();
99
+ $this->stopPlugin();
100
+ return false;
101
+ }
102
+ else $url=$this->login_ok;
103
+ $res=$this->get($url);
104
+ if ($this->checkResponse("get_friends",$res))
105
+ $this->updateDebugBuffer('get_friends',$url,'GET');
106
+ else
107
+ {
108
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
109
+ $this->debugRequest();
110
+ $this->stopPlugin();
111
+ return false;
112
+ }
113
+
114
+ $contacts=array();
115
+ $names_array=$this->getElementDOM($res,'//option');
116
+ $ids_array=$this->getElementDOM($res,'//option','value');
117
+ if (!empty($ids_array))
118
+ foreach($ids_array as $key=>$value) $contacts[$value]=(!empty($names_array[$key])?$names_array[$key]:false);
119
+ return $contacts;
120
+ }
121
+
122
+ /**
123
+ * Send message to contacts
124
+ *
125
+ * Sends a message to the contacts using
126
+ * the service's inernal messaging system
127
+ *
128
+ * @param string $cookie_file The location of the cookies file for the current session
129
+ * @param string $message The message being sent to your contacts
130
+ * @param array $contacts An array of the contacts that will receive the message
131
+ * @return mixed FALSE on failure.
132
+ */
133
+ public function sendMessage($session_id,$message,$contacts)
134
+ {
135
+ $countMessages=0;
136
+ foreach($contacts as $id=>$name)
137
+ {
138
+ $countMessages++;
139
+ $form_action="http://www.lovento.com/en/accounts/message_center/";
140
+ $post_elements=array('doSend'=>'t',
141
+ 'to_id'=>$id,
142
+ 'message_title'=>$message['subject'],
143
+ 'message_text'=>$message['body'],
144
+ );
145
+ $res=$this->post($form_action,$post_elements,true);
146
+ if ($this->checkResponse("send_message",$res))
147
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
148
+ else
149
+ {
150
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
151
+ $this->debugRequest();
152
+ $this->stopPlugin();
153
+ return false;
154
+ }
155
+ sleep($this->messageDelay);
156
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
157
+ }
158
+
159
+ }
160
+
161
+ /**
162
+ * Terminate session
163
+ *
164
+ * Terminates the current user's session,
165
+ * debugs the request and reset's the internal
166
+ * debudder.
167
+ *
168
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
169
+ */
170
+ public function logout()
171
+ {
172
+ if (!$this->checkSession()) return false;
173
+ $res=$this->get("http://www.lovento.com/en/logout/");
174
+ $this->debugRequest();
175
+ $this->resetDebugger();
176
+ $this->stopPlugin();
177
+ return true;
178
+ }
179
+ }
180
+
181
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/lycos.plg.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Lycos',
4
+ 'version'=>'1.1.5',
5
+ 'description'=>"Get the contacts from a Lycos account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://lycos.com',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * Lycos Plugin
15
+ *
16
+ * Import user's contacts from Lycos' AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.9
20
+ */
21
+ class lycos extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'m_U',
30
+ 'login'=>'frame',
31
+ 'export_url'=>'csv',
32
+ 'file_contacts'=>'First Name'
33
+ );
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user,$pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='lycos';
49
+ $this->service_user=$user;
50
+ $this->service_password=$pass;
51
+ $this->timeout=30;
52
+ if (!$this->init()) return false;
53
+
54
+ $res=$this->get("http://mail.lycos.com/lycos/mail/IntroMail.lycos",true);
55
+ if ($this->checkResponse("initial_get",$res))
56
+ $this->updateDebugBuffer('initial_get',"http://lycos.com/",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get',"http://lycos.com/",'GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+ $post_elements=$this->getHiddenElements($res);$post_elements["m_U"]=$user;$post_elements["m_P"]=$pass;
65
+ $post_elements['login']='Sign In';
66
+ $url_login="https://registration.lycos.com/login.php";
67
+ $res=$this->post($url_login,$post_elements,true);
68
+
69
+ if ($this->checkResponse("login",$res))
70
+ $this->updateDebugBuffer('login',"http://registration.lycos.com/login.php?",'GET',true,$post_elements);
71
+ else
72
+ {
73
+ $this->updateDebugBuffer('login',"http://registration.lycos.com/login.php?",'GET',false,$post_elements);
74
+ $this->debugRequest();
75
+ $this->stopPlugin();
76
+ return false;
77
+ }
78
+ $url_export="http://mail.lycos.com/lycos/addrbook/ExportAddr.lycos?ptype=act&fileType=OUTLOOK";
79
+
80
+ $this->login_ok=$url_export;
81
+ return true;
82
+ }
83
+
84
+ /**
85
+ * Get the current user's contacts
86
+ *
87
+ * Makes all the necesarry requests to import
88
+ * the current user's contacts
89
+ *
90
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
91
+ */
92
+ public function getMyContacts()
93
+ {
94
+ if (!$this->login_ok)
95
+ {
96
+ $this->debugRequest();
97
+ $this->stopPlugin();
98
+ return false;
99
+ }
100
+ else $url=$this->login_ok;
101
+ $post_elements=array('ftype'=>'OUTLOOK');
102
+ $res=$this->post($url,$post_elements);
103
+ if ($this->checkResponse("file_contacts",$res))
104
+ {
105
+ $temp=$this->parseCSV($res);
106
+ $contacts=array();
107
+ foreach ($temp as $values)
108
+ {
109
+ if (!empty($values[4]))
110
+ $contacts[$values[4]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
111
+ 'middle_name'=>(!empty($values[1])?$values[1]:false),
112
+ 'last_name'=>(!empty($values[3])?$values[3]:false),
113
+ 'nickname'=>false,
114
+ 'email_1'=>(!empty($values[4])?$values[4]:false),
115
+ 'email_2'=>false,
116
+ 'email_3'=>false,
117
+ 'organization'=>false,
118
+ 'phone_mobile'=>(!empty($values[5])?$values[5]:false),
119
+ 'phone_home'=>(!empty($values[8])?$values[8]:false),
120
+ 'pager'=>false,
121
+ 'address_home'=>false,
122
+ 'address_city'=>(!empty($values[12])?$values[12]:false),
123
+ 'address_state'=>(!empty($values[13])?$values[13]:false),
124
+ 'address_country'=>(!empty($values[15])?$values[15]:false),
125
+ 'postcode_home'=>(!empty($values[14])?$values[14]:false),
126
+ 'company_work'=>(!empty($values[6])?$values[6]:false),
127
+ 'address_work'=>false,
128
+ 'address_work_city'=>(!empty($values[19])?$values[19]:false),
129
+ 'address_work_country'=>(!empty($values[22])?$values[22]:false),
130
+ 'address_work_state'=>(!empty($values[20])?$values[20]:false),
131
+ 'address_work_postcode'=>(!empty($values[21])?$values[21]:false),
132
+ 'fax_work'=>false,
133
+ 'phone_work'=>(!empty($values[7])?$values[7]:false),
134
+ 'website'=>(!empty($values[16])?$values[16]:false),
135
+ 'isq_messenger'=>false,
136
+ 'skype_essenger'=>false,
137
+ 'yahoo_essenger'=>false,
138
+ 'msn_messenger'=>false,
139
+ 'aol_messenger'=>false,
140
+ 'other_messenger'=>false,
141
+ );
142
+ }
143
+ $this->updateDebugBuffer('file_contacts',"{$url}",'GET');
144
+ }
145
+ else
146
+ {
147
+ $this->updateDebugBuffer('file_contacts',"{$url}",'GET',false);
148
+ $this->debugRequest();
149
+ $this->stopPlugin();
150
+ return false;
151
+ }
152
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
153
+ return $this->returnContacts($contacts);
154
+ }
155
+
156
+ /**
157
+ * Terminate session
158
+ *
159
+ * Terminates the current user's session,
160
+ * debugs the request and reset's the internal
161
+ * debudder.
162
+ *
163
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
164
+ */
165
+ public function logout()
166
+ {
167
+ if (!$this->checkSession()) return false;
168
+ $res=$this->get("https://registration.lycos.com/logout.php",true);
169
+ $this->debugRequest();
170
+ $this->resetDebugger();
171
+ $this->stopPlugin();
172
+ return true;
173
+ }
174
+
175
+ }
176
+
177
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mail2world.plg.php ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Mail2World',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Mail2World account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.mail2world.com/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(mail2world.com)/i'),
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * Mail2World Plugin
15
+ *
16
+ * Import user's contacts from Mail2World account
17
+ *
18
+ *
19
+ * @author OpenInviter
20
+ * @version 1.0.0
21
+ */
22
+ class mail2world extends openinviter_base
23
+ {
24
+ private $login_ok=false;
25
+ public $showContacts=true;
26
+ public $internalError=false;
27
+ protected $timeout=30;
28
+
29
+ public $debug_array=array(
30
+ 'initial_get'=>'securebutt',
31
+ 'login_post'=>'G_ViewType',
32
+ 'file_contacts'=>'Name',
33
+ );
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user,$pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='mail2world';
49
+ $this->service_user=$user;
50
+ $this->service_password=$pass;
51
+ if (!$this->init()) return false;
52
+
53
+ $res=$this->get("http://www.mail2world.com/",true);
54
+ if ($this->checkResponse("initial_get",$res))
55
+ $this->updateDebugBuffer('initial_get',"http://www.mail2world.com/",'GET');
56
+ else
57
+ {
58
+ $this->updateDebugBuffer('initial_get',"http://www.mail2world.com/",'GET',false);
59
+ $this->debugRequest();
60
+ $this->stopPlugin();
61
+ return false;
62
+ }
63
+ $userBulk=explode('@',$user);$username=$userBulk[0];$domain=$this->getElementString($user,'@','.');
64
+ $form_action="http://www.mail2world.com/web/app.asp?db_browser=Firefox&db_os=WIN&db_width=1280&db_height=1024";
65
+ $post_elements=array('db_width'=>'1280',
66
+ 'db_height'=>'1024',
67
+ 'db_os'=>'WIN',
68
+ 'db_browser'=>'Firefox',
69
+ 'faction'=>'login',
70
+ 'username'=>$username,
71
+ 'domain'=>$domain,
72
+ 'password'=>$pass,
73
+ 'submitbut.x'=>rand(1,50),
74
+ 'submitbut.y'=>rand(1,50),
75
+ 'securebutt'=>'on'
76
+ );
77
+ $res=$this->post($form_action,$post_elements,true);
78
+ if ($this->checkResponse("login_post",$res))
79
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
80
+ else
81
+ {
82
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
83
+ $this->debugRequest();
84
+ $this->stopPlugin();
85
+ return false;
86
+ }
87
+
88
+ $url_file_contacts='http://www.mail2world.com/contacts/contacts_import_export.asp?action=export&app=Outlook_2000&NewContacts=true&ContactType=all';
89
+ $this->login_ok=$url_file_contacts;
90
+ return true;
91
+ }
92
+
93
+ /**
94
+ * Get the current user's contacts
95
+ *
96
+ * Makes all the necesarry requests to import
97
+ * the current user's contacts
98
+ *
99
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
100
+ */
101
+ public function getMyContacts()
102
+ {
103
+ if (!$this->login_ok)
104
+ {
105
+ $this->debugRequest();
106
+ $this->stopPlugin();
107
+ return false;
108
+ }
109
+ else $url=$this->login_ok;
110
+ $res=$this->get($url);
111
+ if ($this->checkResponse("file_contacts",$res))
112
+ $this->updateDebugBuffer('file_contacts',$url,'GET');
113
+ else
114
+ {
115
+ $this->updateDebugBuffer('file_contacts',$url,'GET',false);
116
+ $this->debugRequest();
117
+ $this->stopPlugin();
118
+ return false;
119
+ }
120
+
121
+ $contacts=array();
122
+ $temp=$this->parseCSV($res);
123
+ $contacts=array();
124
+ foreach ($temp as $values)
125
+ {
126
+ if (!empty($values[3]))
127
+ $contacts[$values[3]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
128
+ 'middle_name'=>(!empty($values[1])?$values[1]:false),
129
+ 'last_name'=>false,
130
+ 'nickname'=>false,
131
+ 'email_1'=>(!empty($values[3])?$values[3]:false),
132
+ 'email_2'=>false,
133
+ 'email_3'=>false,
134
+ 'organization'=>false,
135
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
136
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
137
+ 'pager'=>false,
138
+ 'address_home'=>false,
139
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
140
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
141
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
142
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
143
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
144
+ 'address_work'=>false,
145
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
146
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
147
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
148
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
149
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
150
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
151
+ 'website'=>(!empty($values[12])?$values[12]:false),
152
+ 'isq_messenger'=>false,
153
+ 'skype_essenger'=>false,
154
+ 'yahoo_essenger'=>false,
155
+ 'msn_messenger'=>false,
156
+ 'aol_messenger'=>false,
157
+ 'other_messenger'=>false,
158
+ );
159
+ }
160
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
161
+ return $this->returnContacts($contacts);
162
+ }
163
+
164
+ /**
165
+ * Terminate session
166
+ *
167
+ * Terminates the current user's session,
168
+ * debugs the request and reset's the internal
169
+ * debudder.
170
+ *
171
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
172
+ */
173
+ public function logout()
174
+ {
175
+ if (!$this->checkSession()) return false;
176
+ $res=$this->get("http://www.mail2world.com/logout.asp?action=logout",true);
177
+ $this->debugRequest();
178
+ $this->resetDebugger();
179
+ $this->stopPlugin();
180
+ return true;
181
+ }
182
+ }
183
+
184
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mail_com.plg.php ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Mail.com',
4
+ 'version'=>'1.1.4',
5
+ 'description'=>"Get the contacts from a Mail.com account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.mail.com',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Mail.com
15
+ *
16
+ * Import user's contacts from Mail.com's AddressBook.
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.9
20
+ */
21
+ class mail_com extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'name="mailcom"',
30
+ 'login_post'=>'mailcomframe',
31
+ 'inbox'=>'outblaze',
32
+ 'export_page'=>'addrURL',
33
+ 'post_contacts'=>'csv',
34
+ 'file_contacts'=>'Title'
35
+ );
36
+
37
+ /**
38
+ * Login function
39
+ *
40
+ * Makes all the necessary requests to authenticate
41
+ * the current user to the server.
42
+ *
43
+ * @param string $user The current user.
44
+ * @param string $pass The password for the current user.
45
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
46
+ */
47
+ public function login($user,$pass)
48
+ {
49
+ $this->resetDebugger();
50
+ $this->service='mail_com';
51
+ $this->service_user=$user;
52
+ $this->service_password=$pass;
53
+ if (!$this->init()) return false;
54
+
55
+ $res=$this->get("http://www.mail.com/",true);
56
+
57
+ if ($this->checkResponse('initial_get',$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.mail.com/",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.mail.com/",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+ $form_action=$this->getElementString($res,'name="mailcom" action="','"');
67
+ $post_elements=array("login"=>"{$user}","password"=>"{$pass}","redirlogin"=>1,"siteselected"=>"normal");
68
+ $res=$this->post($form_action,$post_elements,true);
69
+
70
+ if ($this->checkResponse('login_post',$res))
71
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
72
+ else
73
+ {
74
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
75
+ $this->debugRequest();
76
+ $this->stopPlugin();
77
+ return false;
78
+ }
79
+ $url_redirect=$this->getElementDOM($res,"//frame[@name='mailcomframe']",'src');
80
+ $res=$this->get($url_redirect[0],true);
81
+
82
+ $this->login_ok=$url_redirect[0];
83
+ return true;
84
+ }
85
+
86
+ /**
87
+ * Get the current user's contacts
88
+ *
89
+ * Makes all the necesarry requests to import
90
+ * the current user's contacts
91
+ *
92
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
93
+ */
94
+ public function getMyContacts()
95
+ {
96
+ if (!$this->login_ok)
97
+ {
98
+ $this->debugRequest();
99
+ $this->stopPlugin();
100
+ return false;
101
+ }
102
+ else $url=$this->login_ok;
103
+ $res=$this->get($url,true);
104
+
105
+ if ($this->checkResponse('inbox',$res))
106
+ $this->updateDebugBuffer('login_post',"{$url}",'GET');
107
+ else
108
+ {
109
+ $this->updateDebugBuffer('login_post',"{$url}",'GET',false);
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+ $url_contacts=$this->getElementDOM($res,"//a[@id='addrURL']",'href');
115
+ $res=$this->get($url_contacts[0],true);
116
+
117
+ if ($this->checkResponse("export_page",$res))
118
+ {
119
+ $url_export="";
120
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
121
+ $xpath=new DOMXPath($doc);$query="//a[@href]";$data=$xpath->query($query);
122
+ foreach($data as $val)
123
+ if (strstr($val->nodeValue,"Import/Export")) $url_export=$val->getAttribute('href')."&gab=1";
124
+ $this->updateDebugBuffer('post_contacts',"{$url_contacts[0]}",'GET');
125
+ }
126
+ else
127
+ {
128
+ $this->updateDebugBuffer('post_contacts',"{$url_contacts[0]}",'GET',false);
129
+ $this->debugRequest();
130
+ $this->stopPlugin();
131
+ return false;
132
+ }
133
+ $post_elements=array("showexport"=>"showexport","action"=>"export","format"=>"csv");
134
+ $res=$this->post($url_export,$post_elements);
135
+
136
+ if ($this->checkResponse('file_contacts',$res))
137
+ {
138
+ $temp=$this->parseCSV($res);
139
+ $contacts=array();
140
+ foreach ($temp as $values)
141
+ {
142
+ $name=$values['0'].(empty($values['1'])?'':(empty($values['0'])?'':'-')."{$values['1']}").(empty($values['3'])?'':" \"{$values['3']}\"").(empty($values['2'])?'':' '.$values['2']);
143
+ if (!empty($values['4']))
144
+ $contacts[$values['4']]=(empty($name)?$values['4']:$name);
145
+ if (!empty($values['12']))
146
+ $contacts[$values['12']]=(empty($name)?$values['12']:$name);
147
+ if (!empty($values['13']))
148
+ $contacts[$values['13']]=(empty($name)?$values['13']:$name);
149
+ }
150
+
151
+ //full description
152
+ $teM=explode(PHP_EOL,$res);$arrayDescriptionFlag=explode(',',$teM[0]);
153
+ foreach($temp as $tempA)
154
+ {
155
+ $name=$tempA['0'].(empty($tempA['1'])?'':(empty($tempA['0'])?'':'-')."{$tempA['1']}").(empty($tempA['3'])?'':" \"{$tempA['3']}\"").(empty($tempA['2'])?'':' '.$tempA['2']);
156
+ foreach ($arrayDescriptionFlag as $key=>$value)
157
+ $descriptionArray[(!empty($name)?$name:(!empty($tempA[4])?$tempA[4]:false))][$value]=isset($tempA[$key])?$tempA[$key]:false;
158
+ }
159
+ //print_R($descriptionArray);
160
+
161
+ $this->updateDebugBuffer('login_post',"{$url_export}",'POST',true,$post_elements);
162
+ }
163
+ else
164
+ {
165
+ $this->updateDebugBuffer('login_post',"{$url_export}",'POST',false,$post_elements);
166
+ $this->debugRequest();
167
+ $this->stopPlugin();
168
+ return false;
169
+ }
170
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
171
+ return $descriptionArray;
172
+ }
173
+
174
+ /**
175
+ * Terminate session
176
+ *
177
+ * Terminates the current user's session,
178
+ * debugs the request and reset's the internal
179
+ * debudder.
180
+ *
181
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
182
+ */
183
+ public function logout()
184
+ {
185
+ if (!$this->checkSession()) return false;
186
+ $res=$this->get("http://www.mail.com/logout.aspx");
187
+ $this->debugRequest();
188
+ $this->resetDebugger();
189
+ $this->stopPlugin();
190
+ return true;
191
+ }
192
+
193
+ }
194
+
195
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mail_in.plg.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Mail.in',
4
+ 'version'=>'1.0.3',
5
+ 'description'=>"Get the contacts from a Mail.in account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://mail.in.com/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(in.com)/i'),
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Mail_in Plugin
15
+ *
16
+ * Imports user's contacts from Mail.in's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class mail_in extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array('initial_get'=>'frmloginverify',
29
+ 'post_login'=>'inboxmailshide',
30
+ 'contacts_page'=>'displaycontacts',
31
+ );
32
+
33
+ /**
34
+ * Login function
35
+ *
36
+ * Makes all the necessary requests to authenticate
37
+ * the current user to the server.
38
+ *
39
+ * @param string $user The current user.
40
+ * @param string $pass The password for the current user.
41
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
42
+ */
43
+ public function login($user, $pass)
44
+ {
45
+ $this->resetDebugger();
46
+ $this->service='mail_in';
47
+ $this->service_user=$user;
48
+ $this->service_password=$pass;
49
+ if (!$this->init()) return false;
50
+
51
+ $res=$this->get("http://mail.in.com/");
52
+ if ($this->checkResponse('initial_get',$res))
53
+ $this->updateDebugBuffer('initial_get',"http://mail.in.com/",'GET');
54
+ else
55
+ {
56
+ $this->updateDebugBuffer('initial_get',"http://mail.in.com/",'GET',false);
57
+ $this->debugRequest();
58
+ $this->stopPlugin();
59
+ return false;
60
+ }
61
+ $form_action='http://mail.in.com'.$this->getElementString($res,'name="frmloginverify" method="POST" action="','"');
62
+ $post_elements=array('f_sourceret'=>'http://mail.in.com/mails/mailstartup','f_id'=>$user,'f_pwd'=>$pass);
63
+ $res=$this->post($form_action,$post_elements,true);
64
+ if ($this->checkResponse('post_login',$res))
65
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',true,$post_elements);
66
+ else
67
+ {
68
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',false,$post_elements);
69
+ $this->debugRequest();
70
+ $this->stopPlugin();
71
+ return false;
72
+ }
73
+
74
+ $url_contacts='http://mail.in.com/mails/getcontacts.php';
75
+ $this->login_ok=$url_contacts;
76
+ return true;
77
+ }
78
+
79
+ /**
80
+ * Get the current user's contacts
81
+ *
82
+ * Makes all the necesarry requests to import
83
+ * the current user's contacts
84
+ *
85
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
86
+ */
87
+ public function getMyContacts()
88
+ {
89
+ if (!$this->login_ok)
90
+ {
91
+ $this->debugRequest();
92
+ $this->stopPlugin();
93
+ return false;
94
+ }
95
+ else $url=$this->login_ok;
96
+ $res=$this->get($url);
97
+ if ($this->checkResponse('contacts_page',$res))
98
+ $this->updateDebugBuffer('contacts_page',$url,'GET');
99
+ else
100
+ {
101
+ $this->updateDebugBuffer('contacts_page',$url,'GET',false);
102
+ $this->debugRequest();
103
+ $this->stopPlugin();
104
+ return false;
105
+ }
106
+
107
+ $contacts=array();
108
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
109
+ $xpath=new DOMXPath($doc);$query="//td";$data=$xpath->query($query);
110
+ foreach($data as $node)
111
+ {
112
+ if (strpos($node->getAttribute('onclick'),'displaycontacts')!==false)
113
+ {
114
+ $name=$node->nodeValue;
115
+ $email_array=explode("'",(string)$node->getAttribute('onclick'));
116
+ if (!empty($email_array[1])) $contacts[$email_array[1]]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$email_array[1]);
117
+ }
118
+ }
119
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
120
+ return $this->returnContacts($contacts);
121
+ }
122
+
123
+ /**
124
+ * Terminate session
125
+ *
126
+ * Terminates the current user's session,
127
+ * debugs the request and reset's the internal
128
+ * debudder.
129
+ *
130
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
131
+ */
132
+ public function logout()
133
+ {
134
+ if (!$this->checkSession()) return false;
135
+ $res=$this->get('http://mail.in.com/logout',true);
136
+ $this->debugRequest();
137
+ $this->resetDebugger();
138
+ $this->stopPlugin();
139
+ }
140
+ }
141
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mail_ru.plg.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Mail.ru',
4
+ 'version'=>'1.1.4',
5
+ 'description'=>"Get the contacts from a Mail.ru account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.mail.ru',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(in.com)/i','/(list.ru)/i','/(inbox.ru)/i','/(bk.ru)/i','/(mail.ru)/i'),
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * Mail.ru Plugin
15
+ *
16
+ * Import user's contacts from Mail.ru's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.9
20
+ */
21
+ class mail_ru extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'login',
30
+ 'login_post'=>'lowSupported',
31
+ 'file_contacts'=>'"'
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user,$pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='mail_ru';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("http://www.mail.ru/",true);
53
+ if ($this->checkResponse("initial_get",$res))
54
+ $this->updateDebugBuffer('initial_get',"http://www.mail.ru/",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"http://www.mail.ru/",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+
63
+ $array_user=explode("@",$user);$domain=strtolower($array_user[1]);
64
+ $hidden_element=$this->getElementDOM($res,"//input[@name='Mpopl']","value");
65
+ $post_elements=array('Domain'=>$domain,'Login'=>$user,'Password'=>$pass,'Mpopl'=>$hidden_element[0]);
66
+ $res=$this->post("http://win.mail.ru/cgi-bin/auth",$post_elements,true);
67
+ if ($this->checkResponse("login_post",$res))
68
+ $this->updateDebugBuffer('login_post',"http://win.mail.ru/cgi-bin/auth",'POST',true,$post_elements);
69
+ else
70
+ {
71
+ $this->updateDebugBuffer('login_post',"http://win.mail.ru/cgi-bin/auth",'POST',false,$post_elements);
72
+ $this->debugRequest();
73
+ $this->stopPlugin();
74
+ return false;
75
+ }
76
+ $url_export="http://win.mail.ru/cgi-bin/abexport/addressbook.csv";
77
+ $this->login_ok=$url_export;
78
+ return true;
79
+ }
80
+
81
+ /**
82
+ * Get the current user's contacts
83
+ *
84
+ * Makes all the necesarry requests to import
85
+ * the current user's contacts
86
+ *
87
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
88
+ */
89
+ public function getMyContacts()
90
+ {
91
+ if (!$this->login_ok)
92
+ {
93
+ $this->debugRequest();
94
+ $this->stopPlugin();
95
+ return false;
96
+ }
97
+ else $url=$this->login_ok;
98
+ $post_elements=array("confirm"=>"1","abtype"=>"1");
99
+ $res=$this->post($url,$post_elements);
100
+ if ($this->checkResponse("file_contacts",$res))
101
+ {
102
+ $temp=$this->parseCSV($res);$teM=explode(PHP_EOL,$res);$arrayDescriptionFlag=explode(',',$teM[0]);
103
+ $contacts=array();
104
+ foreach ($temp as $values)
105
+ {
106
+ $contacts[$values[8]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
107
+ 'middle_name'=>(!empty($values[2])?$values[2]:false),
108
+ 'last_name'=>(!empty($values[1])?$values[1]:false),
109
+ 'nickname'=>false,
110
+ 'email_1'=>(!empty($values[8])?$values[8]:false),
111
+ 'email_2'=>(!empty($values[9])?$values[9]:false),
112
+ 'email_3'=>false,
113
+ 'organization'=>false,
114
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
115
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
116
+ 'pager'=>false,
117
+ 'address_home'=>false,
118
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
119
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
120
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
121
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
122
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
123
+ 'address_work'=>false,
124
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
125
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
126
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
127
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
128
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
129
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
130
+ 'website'=>(!empty($values[12])?$values[12]:false),
131
+ 'isq_messenger'=>false,
132
+ 'skype_essenger'=>false,
133
+ 'yahoo_essenger'=>false,
134
+ 'msn_messenger'=>false,
135
+ 'aol_messenger'=>false,
136
+ 'other_messenger'=>false,
137
+ );
138
+ }
139
+ $this->updateDebugBuffer('file_contacts',"{$url}",'POST',true,$post_elements);
140
+ }
141
+ else
142
+ {
143
+ $this->updateDebugBuffer('file_contacts',"{$url}",'POST',false,$post_elements);
144
+ $this->debugRequest();
145
+ $this->stopPlugin();
146
+ return false;
147
+ }
148
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
149
+ return $this->returnContacts($contacts);
150
+
151
+ }
152
+
153
+ /**
154
+ * Terminate session
155
+ *
156
+ * Terminates the current user's session,
157
+ * debugs the request and reset's the internal
158
+ * debudder.
159
+ *
160
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
161
+ */
162
+ public function logout()
163
+ {
164
+ if (!$this->checkSession()) return false;
165
+ $res=$this->get("http://win.mail.ru/cgi-bin/logout",true);
166
+ $this->debugRequest();
167
+ $this->resetDebugger();
168
+ $this->stopPlugin();
169
+ return true;
170
+ }
171
+
172
+ }
173
+
174
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/meinvz.plg.php ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Meinvz
3
+ * You can send message to your MeinVz Inbox
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Meinvz',
7
+ 'version'=>'1.0.7',
8
+ 'description'=>"Get the contacts from a MeinVz account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.meinvz.net/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * MeinVz Plugin
17
+ *
18
+ * Import user's contacts from MeinVz and send
19
+ * messages using the internal messaging system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class meinvz extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'password',
33
+ 'login_post'=>'Friends',
34
+ 'url_friends'=>'name',
35
+ 'url_send_message'=>'Messages_searchfield',
36
+ 'send_message'=>'SendSuccessAd'
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='meinvz';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("http://www.meinvz.net/");
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"http://www.meinvz.com/",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"http://www.meinvz.com/",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+ $form_action="https://secure.meinvz.net/Login ";
68
+ $post_elements=array('email'=>$user,'password'=>$pass,'login'=>'Login','jsEnabled'=>'true','ipRestriction'=>1,'formkey'=>$this->getElementString($res,'name="formkey" value="','"'),'iv'=>$this->getElementString($res,'name="iv" value="','"'));
69
+ $res=$this->post($form_action,$post_elements,true);
70
+ if ($this->checkResponse("login_post",$res))
71
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
72
+ else
73
+ {
74
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
75
+ $this->debugRequest();
76
+ $this->stopPlugin();
77
+ return false;
78
+ }
79
+ $url_logout='http://www.meinvz.net/Logout/'.$this->getElementString($res,'<li><a href="/Logout/','"');
80
+ $url_friends='http://www.meinvz.net/Messages/WriteMessage';
81
+ $this->login_ok=$url_friends;
82
+ file_put_contents($this->getLogoutPath(),$url_logout);
83
+ return true;
84
+ }
85
+
86
+ /**
87
+ * Get the current user's contacts
88
+ *
89
+ * Makes all the necesarry requests to import
90
+ * the current user's contacts
91
+ *
92
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
93
+ */
94
+ public function getMyContacts()
95
+ {
96
+ if (!$this->login_ok)
97
+ {
98
+ $this->debugRequest();
99
+ $this->stopPlugin();
100
+ return false;
101
+ }
102
+ else $url=$this->login_ok;
103
+ $res=$this->get($url,true);
104
+ if ($this->checkResponse("url_friends",$res))
105
+ $this->updateDebugBuffer('url_friends',$url,'GET');
106
+ else
107
+ {
108
+ $this->updateDebugBuffer('url_friends',$url,'GET',false);
109
+ $this->debugRequest();
110
+ $this->stopPlugin();
111
+ return false;
112
+ }
113
+ $contacts=array();
114
+ if (preg_match_all("#\&\#34\;name\&\#34\;\:\&\#34\;(.+)\&\#34\;\,\&\#34\;profile\&\#34\;\:\&\#34\;\\\/Profile\\\/(.+)\&\#34\;#U",$res,$matches))
115
+ {
116
+ if (!empty($matches[2]))
117
+ foreach($matches[2] as $key=>$id)
118
+ if (!empty($matches[1][$key])) $contacts[$id]=$matches[1][$key];
119
+ }
120
+ return $contacts;
121
+ }
122
+
123
+ /**
124
+ * Send message to contacts
125
+ *
126
+ * Sends a message to the contacts using
127
+ * the service's inernal messaging system
128
+ *
129
+ * @param string $cookie_file The location of the cookies file for the current session
130
+ * @param string $message The message being sent to your contacts
131
+ * @param array $contacts An array of the contacts that will receive the message
132
+ * @return mixed FALSE on failure.
133
+ */
134
+ public function sendMessage($session_id,$message,$contacts)
135
+ {
136
+ $countMessages=0;
137
+ foreach($contacts as $href=>$name)
138
+ {
139
+ $countMessages++;
140
+ $url_send_message="http://www.meinvz.net{$href}";
141
+ $res=$this->get($url_send_message,true);
142
+ if ($this->checkResponse("url_send_message",$res))
143
+ $this->updateDebugBuffer('url_send_message',"shttp://www.bebo.com/",'GET');
144
+ else
145
+ {
146
+ $this->updateDebugBuffer('url_send_message',"http://www.bebo.com/",'GET',false);
147
+ $this->debugRequest();
148
+ $this->stopPlugin();
149
+ return false;
150
+ }
151
+ $form_action=$url_send_message;
152
+ $formkey_array=$this->getElementDOM($res,"//input[@name='formkey']",'value');
153
+ $checkcode_array=$this->getElementDOM($res,"//input[@name='checkcode']",'value');
154
+ $iv_array=$this->getElementDOM($res,"//input[@name='iv']",'value');
155
+ $post_elements=array('recipientIds[]'=>$this->getElementString($res,'friendList" value="{&#34;','&#34;'),
156
+ 'subject'=>$message['subject'],
157
+ 'message'=>$message['body'],
158
+ 'recipientIdForHistory'=>$this->getElementString($res,'friendList" value="{&#34;','&#34;'),
159
+ 'formkey'=>$formkey_array[1],
160
+ 'iv'=>$iv_array[1],
161
+ 'checkcode'=>$checkcode_array[1],
162
+ );
163
+ $res=$this->post($form_action,$post_elements,true);
164
+ if ($this->checkResponse("send_message",$res))
165
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
166
+ else
167
+ {
168
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
169
+ $this->debugRequest();
170
+ $this->stopPlugin();
171
+ return false;
172
+ }
173
+ sleep($this->messageDelay);
174
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
175
+ }
176
+ }
177
+
178
+ /**
179
+ * Terminate session
180
+ *
181
+ * Terminates the current user's session,
182
+ * debugs the request and reset's the internal
183
+ * debudder.
184
+ *
185
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
186
+ */
187
+ public function logout()
188
+ {
189
+ if (!$this->checkSession()) return false;
190
+ if (file_exists($this->getLogoutPath()))
191
+ {
192
+ $url_logout=file_get_contents($this->getLogoutPath());
193
+ $res=$this->get($url_logout,true);
194
+ }
195
+ $this->debugRequest();
196
+ $this->resetDebugger();
197
+ $this->stopPlugin();
198
+ return true;
199
+ }
200
+ }
201
+
202
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/meta.plg.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Meta',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Meta account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://meta.ua/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * Meta Plugin
15
+ *
16
+ * Imports user's contacts from Meta AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class meta extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'login',
30
+ 'login_post'=>'INBOX',
31
+ 'file_contacts'=>'Name',
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user,$pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='meta';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("http://meta.ua/");
53
+ if ($this->checkResponse("initial_get",$res))
54
+ $this->updateDebugBuffer('initial_get',"http://meta.ua/",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"http://meta.ua/",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+
63
+ $form_action="http://passport.meta.ua/";
64
+ $post_elements=array('login'=>$user,'password'=>$pass,'mode'=>'login','from'=>'mail','lifetime'=>'alltime','subm'=>'Enter');
65
+ $res=$this->post($form_action,$post_elements,true);
66
+ if ($this->checkResponse('login_post',$res))
67
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
68
+ else
69
+ {
70
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
71
+ $this->debugRequest();
72
+ $this->stopPlugin();
73
+ return false;
74
+ }
75
+
76
+ $this->login_ok=true;
77
+ return true;
78
+ }
79
+
80
+ /**
81
+ * Get the current user's contacts
82
+ *
83
+ * Makes all the necesarry requests to import
84
+ * the current user's contacts
85
+ *
86
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
87
+ */
88
+ public function getMyContacts()
89
+ {
90
+ if (!$this->login_ok)
91
+ {
92
+ $this->debugRequest();
93
+ $this->stopPlugin();
94
+ return false;
95
+ }
96
+
97
+ $form_action="http://webmail.meta.ua/adress_transfer.php";
98
+ $post_elements=array('mail_client'=>'outlook_en','js_enable'=>false,'action'=>'export','groups[]'=>'all','subm'=>true);
99
+ $res=$this->post($form_action,$post_elements);
100
+ if ($this->checkResponse("file_contacts",$res))
101
+ $this->updateDebugBuffer('file_contacts',$form_action,'POST',true,$post_elements);
102
+ else
103
+ {
104
+ $this->updateDebugBuffer('file_contacts',$form_action,'POST',false,$post_elements);
105
+ $this->debugRequest();
106
+ $this->stopPlugin();
107
+ return false;
108
+ }
109
+
110
+ $contacts=array();$tempFile=explode(PHP_EOL,$res);unset($tempFile[0]);
111
+ foreach ($tempFile as $valuesTemp)
112
+ {
113
+ $values=explode(';',$valuesTemp);
114
+ if (!empty($values[4]))
115
+ $contacts[$values[4]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
116
+ 'middle_name'=>(!empty($values[2])?$values[2]:false),
117
+ 'last_name'=>(!empty($values[1])?$values[1]:false),
118
+ 'nickname'=>false,
119
+ 'email_1'=>(!empty($values[4])?$values[4]:false),
120
+ 'email_2'=>(!empty($values[5])?$values[5]:false),
121
+ 'email_3'=>false,
122
+ 'organization'=>false,
123
+ 'phone_mobile'=>(!empty($values[13])?$values[13]:false),
124
+ 'phone_home'=>(!empty($values[11])?$values[11]:false),
125
+ 'pager'=>(!empty($values[23])?$values[23]:false),
126
+ 'address_home'=>false,
127
+ 'address_city'=>(!empty($values[7])?$values[7]:false),
128
+ 'address_state'=>(!empty($values[9])?$values[9]:false),
129
+ 'address_country'=>(!empty($values[10])?$values[10]:false),
130
+ 'postcode_home'=>(!empty($values[8])?$values[8]:false),
131
+ 'company_work'=>(!empty($values[24])?$values[24]:false),
132
+ 'address_work'=>false,
133
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
134
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
135
+ 'address_work_state'=>(!empty($values[18])?$values[18]:false),
136
+ 'address_work_postcode'=>(!empty($values[17])?$values[17]:false),
137
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
138
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
139
+ 'website'=>(!empty($values[14])?$values[14]:false),
140
+ 'isq_messenger'=>false,
141
+ 'skype_essenger'=>false,
142
+ 'yahoo_essenger'=>false,
143
+ 'msn_messenger'=>false,
144
+ 'aol_messenger'=>false,
145
+ 'other_messenger'=>false,
146
+ );
147
+ }
148
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
149
+ return $this->returnContacts($contacts);
150
+ }
151
+
152
+ /**
153
+ * Terminate session
154
+ *
155
+ * Terminates the current user's session,
156
+ * debugs the request and reset's the internal
157
+ * debudder.
158
+ *
159
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
160
+ */
161
+ public function logout()
162
+ {
163
+ if (!$this->checkSession()) return false;
164
+ $res=$this->get('http://webmail.meta.ua/logout.php',true);
165
+ $this->debugRequest();
166
+ $this->resetDebugger();
167
+ $this->stopPlugin();
168
+ return true;
169
+ }
170
+
171
+ }
172
+
173
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mevio.plg.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Mevio
3
+ * You can Send Private Messages using mevio system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Mevio',
7
+ 'version'=>'1.0.4',
8
+ 'description'=>"Get the contacts from a Mevio account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.mevio.com/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Mvio Plugin
17
+ *
18
+ * Import user's contacts from Mevio and send Private messages
19
+ * using Mevio system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class mevio extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+
30
+ public $debug_array=array(
31
+ 'initial_get'=>'username',
32
+ 'login_post'=>'activePersona=',
33
+ 'url_home'=>'selected nobg',
34
+ 'get_friends'=>'laminate-std-name',
35
+ 'url_friend'=>'personaId',
36
+ 'url_send_message'=>'subject',
37
+ 'send_message'=>'message sent'
38
+ );
39
+
40
+ /**
41
+ * Login function
42
+ *
43
+ * Makes all the necessary requests to authenticate
44
+ * the current user to the server.
45
+ *
46
+ * @param string $user The current user.
47
+ * @param string $pass The password for the current user.
48
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
49
+ */
50
+ public function login($user,$pass)
51
+ {
52
+ $this->resetDebugger();
53
+ $this->service='mevio';
54
+ $this->service_user=$user;
55
+ $this->service_password=$pass;
56
+ if (!$this->init()) return false;
57
+
58
+ $res=$this->get("http://www.mevio.com/login/#loginOverlay",true);
59
+ if ($this->checkResponse("initial_get",$res))
60
+ $this->updateDebugBuffer('initial_get',"http://us.cyworld.com/",'GET');
61
+ else
62
+ {
63
+ $this->updateDebugBuffer('initial_get',"http://us.cyworld.com/",'GET',false);
64
+ $this->debugRequest();
65
+ $this->stopPlugin();
66
+ return false;
67
+ }
68
+
69
+ $form_action="http://www.mevio.com/login/#loginOverlay";
70
+ $post_elements=array('username'=>$user,'password'=>$pass,'LoginSubmit'=>'Log In');
71
+ $res=$this->post($form_action,$post_elements,true);
72
+ if ($this->checkResponse("login_post",$res))
73
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
74
+ else
75
+ {
76
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
77
+ $this->debugRequest();
78
+ $this->stopPlugin();
79
+ return false;
80
+ }
81
+
82
+ $url_profile='http://www.mevio.com/mc/digs/?control=Digs&action=editDigs&digMode=entourage&activePersona='.$this->getElementString($res,'http://www.mevio.com/mc/digs/?control=Digs&action=editDigs&digMode=entourage&activePersona=','"');
83
+ $this->login_ok=$url_profile;
84
+ return true;
85
+ }
86
+
87
+ /**
88
+ * Get the current user's contacts
89
+ *
90
+ * Makes all the necesarry requests to import
91
+ * the current user's contacts
92
+ *
93
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
94
+ */
95
+ public function getMyContacts()
96
+ {
97
+ if (!$this->login_ok)
98
+ {
99
+ $this->debugRequest();
100
+ $this->stopPlugin();
101
+ return false;
102
+ }
103
+ else $url=$this->login_ok;
104
+ $res=$this->get($url);
105
+ if ($this->checkResponse("get_friends",$res))
106
+ $this->updateDebugBuffer('get_friends',$url,'GET');
107
+ else
108
+ {
109
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+
115
+ $contacts=array();
116
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
117
+ $xpath=new DOMXPath($doc);$query="//div[@class='laminate-std-name']";$data=$xpath->query($query);
118
+ foreach($data as $node)
119
+ {
120
+ $name=$node->childNodes->item(1)->nodeValue;
121
+ $href=$node->childNodes->item(1)->getAttribute('href');
122
+ if (!empty($href)) $contacts[$href]=$name;
123
+ }
124
+ return $contacts;
125
+ }
126
+
127
+ /**
128
+ * Send message to contacts
129
+ *
130
+ * Sends a message to the contacts using
131
+ * the service's inernal messaging system
132
+ *
133
+ * @param string $cookie_file The location of the cookies file for the current session
134
+ * @param string $message The message being sent to your contacts
135
+ * @param array $contacts An array of the contacts that will receive the message
136
+ * @return mixed FALSE on failure.
137
+ */
138
+ public function sendMessage($session_id,$message,$contacts)
139
+ {
140
+ $countMessages=0;
141
+ foreach($contacts as $href=>$name)
142
+ {
143
+ $countMessages++;
144
+ $res=$this->get($href,true);
145
+ if ($this->checkResponse("url_friend",$res))
146
+ $this->updateDebugBuffer('url_friend',$href,'GET');
147
+ else
148
+ {
149
+ $this->updateDebugBuffer('url_friend',$href,'GET',false);
150
+ $this->debugRequest();
151
+ $this->stopPlugin();
152
+ return false;
153
+ }
154
+ $friend_id=$this->getElementString($res,'"personaId":"','"');
155
+ $url_send_message='http://www.mevio.com/u2u/?class=NewTextMessage&method=auto_compose&to_select='.$friend_id;
156
+ $res=$this->get($url_send_message,true);
157
+ if ($this->checkResponse("url_send_message",$res))
158
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET');
159
+ else
160
+ {
161
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET',false);
162
+ $this->debugRequest();
163
+ $this->stopPlugin();
164
+ return false;
165
+ }
166
+
167
+ $form_action="http://www.mevio.com/u2u/?class=NewTextMessage&method=send";
168
+ $post_elements=array( 'to_select[]'=>$friend_id,
169
+ 'subject'=>$message['subject'],
170
+ 'body'=>$message['body'],
171
+ 'response'=>'message_center'
172
+ );
173
+ $res=$this->post($form_action,$post_elements);
174
+ if ($this->checkResponse("send_message",$res))
175
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
176
+ else
177
+ {
178
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
179
+ $this->debugRequest();
180
+ $this->stopPlugin();
181
+ return false;
182
+ }
183
+ sleep($this->messageDelay);
184
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
185
+ }
186
+
187
+ }
188
+
189
+ /**
190
+ * Terminate session
191
+ *
192
+ * Terminates the current user's session,
193
+ * debugs the request and reset's the internal
194
+ * debudder.
195
+ *
196
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
197
+ */
198
+ public function logout()
199
+ {
200
+ if (!$this->checkSession()) return false;
201
+ $res=$this->get("http://www.mevio.com/login/?mode=logout");
202
+ $this->debugRequest();
203
+ $this->resetDebugger();
204
+ $this->stopPlugin();
205
+ return true;
206
+ }
207
+ }
208
+
209
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/motortopia.plg.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Motortopia
3
+ * You can Write Private Messages using Motortopia system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Motortopia',
7
+ 'version'=>'1.0.3',
8
+ 'description'=>"Get the contacts from a Motortopia account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.motortopia.com/main/cars',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Motortopia Plugin
17
+ *
18
+ * Import Friends from Motortopia
19
+ * You can Write Private Messages using Motortopia system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class motortopia extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'email',
33
+ 'login_post'=>'logout',
34
+ 'get_friends'=>'Go to this person',
35
+ 'send_message'=>'inbox'
36
+ );
37
+
38
+ /**
39
+ * Login function
40
+ *
41
+ * Makes all the necessary requests to authenticate
42
+ * the current user to the server.
43
+ *
44
+ * @param string $user The current user.
45
+ * @param string $pass The password for the current user.
46
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
47
+ */
48
+ public function login($user,$pass)
49
+ {
50
+ $this->resetDebugger();
51
+ $this->service='motortopia';
52
+ $this->service_user=$user;
53
+ $this->service_password=$pass;
54
+ if (!$this->init()) return false;
55
+
56
+ $res=$this->get("http://www.motortopia.com/main/cars",true);
57
+ if ($this->checkResponse("initial_get",$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.motortopia.com/en/",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.motortopia.com/en/",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+
67
+ $form_action="http://www.motortopia.com/user/login/main/y";
68
+ $post_elements=array('email'=>$user,
69
+ 'password'=>$pass,
70
+ 'submit'=>'Login',
71
+ 'token'=>$this->getElementString($res,'name="token" value="','"')
72
+ );
73
+ $res=$this->post($form_action,$post_elements,true);
74
+ if ($this->checkResponse("login_post",$res))
75
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
76
+ else
77
+ {
78
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
79
+ $this->debugRequest();
80
+ $this->stopPlugin();
81
+ return false;
82
+ }
83
+ $url_friends='http://www.motortopia.com/friend/browse/u/'.$this->getElementString($res,'/friend/browse/u/','"');
84
+ $this->login_ok=$url_friends;
85
+ return true;
86
+ }
87
+
88
+ /**
89
+ * Get the current user's contacts
90
+ *
91
+ * Makes all the necesarry requests to import
92
+ * the current user's contacts
93
+ *
94
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
95
+ */
96
+ public function getMyContacts()
97
+ {
98
+ if (!$this->login_ok)
99
+ {
100
+ $this->debugRequest();
101
+ $this->stopPlugin();
102
+ return false;
103
+ }
104
+ else $url=$this->login_ok;
105
+ $res=$this->get($url);
106
+ if ($this->checkResponse("get_friends",$res))
107
+ $this->updateDebugBuffer('get_friends',$url,'GET');
108
+ else
109
+ {
110
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
111
+ $this->debugRequest();
112
+ $this->stopPlugin();
113
+ return false;
114
+ }
115
+
116
+ $contacts=array();
117
+ $names_array=$this->getElementDOM($res,"//dd[@class='allHead']");
118
+ if (!empty($names_array))
119
+ foreach($names_array as $key=>$value) $contacts[$value]=$value;
120
+ return $contacts;
121
+ }
122
+
123
+ /**
124
+ * Send message to contacts
125
+ *
126
+ * Sends a message to the contacts using
127
+ * the service's inernal messaging system
128
+ *
129
+ * @param string $cookie_file The location of the cookies file for the current session
130
+ * @param string $message The message being sent to your contacts
131
+ * @param array $contacts An array of the contacts that will receive the message
132
+ * @return mixed FALSE on failure.
133
+ */
134
+ public function sendMessage($session_id,$message,$contacts)
135
+ {
136
+ $countMessages=0;
137
+ foreach($contacts as $name)
138
+ {
139
+ $countMessages++;
140
+ $form_action="http://www.motortopia.com/mail/send/{$name}";
141
+ $post_elements=array('subject'=>$message['subject'],'body'=>$message['body'],'submit'=>'Send');
142
+ $res=$this->post($form_action,$post_elements,true);
143
+
144
+ if ($this->checkResponse("send_message",$res))
145
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
146
+ else
147
+ {
148
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
149
+ $this->debugRequest();
150
+ $this->stopPlugin();
151
+ return false;
152
+ }
153
+ sleep($this->messageDelay);
154
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
155
+ }
156
+
157
+ }
158
+
159
+ /**
160
+ * Terminate session
161
+ *
162
+ * Terminates the current user's session,
163
+ * debugs the request and reset's the internal
164
+ * debudder.
165
+ *
166
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
167
+ */
168
+ public function logout()
169
+ {
170
+ if (!$this->checkSession()) return false;
171
+ $res=$this->get("http://www.motortopia.com/user/logout");
172
+ $this->debugRequest();
173
+ $this->resetDebugger();
174
+ $this->stopPlugin();
175
+ return true;
176
+ }
177
+ }
178
+
179
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/msn.plg.php ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'MSN',
4
+ 'version'=>'1.0.1',
5
+ 'description'=>"Get the contacts from a MSN People",
6
+ 'base_version'=>'1.8.1',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://home.mobile.live.com/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * MSN Plugin
15
+ *
16
+ * Imports user's contacts from MSN People
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.4.4
20
+ */
21
+ class msn extends OpenInviter_Base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+ protected $userAgent='Mozilla/4.1 (compatible; MSIE 5.0; Symbian OS; Nokia 3650;424) Opera 6.10 [en]';
28
+
29
+ public $debug_array=array(
30
+ 'initial_get'=>'c_signin',
31
+ 'url_login'=>'signup.live',
32
+ 'post_login'=>'function OnBack()',
33
+ 'url_people'=>'SecondaryText',
34
+ 'get_contacts'=>'BoldText'
35
+ );
36
+
37
+ /**
38
+ * Login function
39
+ *
40
+ * Makes all the necessary requests to authenticate
41
+ * the current user to the server.
42
+ *
43
+ * @param string $user The current user.
44
+ * @param string $pass The password for the current user.
45
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
46
+ */
47
+ function login($user,$pass)
48
+ {
49
+ $this->resetDebugger();
50
+ $this->service='msn';
51
+ $this->service_user=$user;
52
+ $this->service_password=$pass;
53
+ if (!$this->init()) return false;
54
+ $res=$this->get("http://home.mobile.live.com/",true);
55
+ if ($this->checkResponse('initial_get',$res))
56
+ $this->updateDebugBuffer('initial_get',"http://home.mobile.live.com/",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get',"http://home.mobile.live.com/",'GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+
65
+ $url_login=html_entity_decode($this->getElementString($res,'id="c_signin" href="','"'));
66
+ $res=$this->get($url_login,true);
67
+ if ($this->checkResponse('url_login',$res))
68
+ $this->updateDebugBuffer('url_login',$url_login,'GET');
69
+ else
70
+ {
71
+ $this->updateDebugBuffer('url_login',$url_login,'GET',false);
72
+ $this->debugRequest();
73
+ $this->stopPlugin();
74
+ return false;
75
+ }
76
+
77
+ $post_action=$this->getElementString($res,"srf_uPost='","'");
78
+ $post_elements=array("idsbho"=>1,
79
+ "LoginOptions"=>2,
80
+ "CS"=>'',
81
+ "FedState"=>'',
82
+ "PPSX"=>$this->getElementString($res,"srf_sRBlob='","'"),
83
+ "type"=>11,
84
+ "login"=>$user,
85
+ "passwd"=>$pass,
86
+ "remMe"=>1,
87
+ "NewUser"=>0,
88
+ "PPFT"=>$this->getElementString($res,'value="','"'),
89
+ "i1"=>0,
90
+ "i2"=>2,
91
+ );
92
+ $res=$this->post($post_action,$post_elements,true);
93
+ if (strpos($res,"DoSubmit()")!==false)
94
+ {
95
+ $form_action=$this->getElementString($res,'action="','"');
96
+ $post_elements=array('wa'=>'wsignin1.0');
97
+ $res=$this->post($form_action,$post_elements,true);
98
+ }
99
+ if ($this->checkResponse('post_login',$res))
100
+ $this->updateDebugBuffer('post_login',"{$post_action}",'POST',true,$post_elements);
101
+ else
102
+ {
103
+ $this->updateDebugBuffer('post_login',"{$post_action}",'POST',false,$post_elements);
104
+ $this->debugRequest();
105
+ $this->stopPlugin();
106
+ return false;
107
+ }
108
+
109
+ $url_mobile='http://mpeople.live.com/default.aspx?pg=0';
110
+ $this->login_ok=$url_mobile;
111
+ return true;
112
+ }
113
+
114
+ /**
115
+ * Get the current user's contacts
116
+ *
117
+ * Makes all the necesarry requests to import
118
+ * the current user's contacts
119
+ *
120
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
121
+ */
122
+ public function getMyContacts()
123
+ {
124
+ if (!$this->login_ok)
125
+ {
126
+ $this->debugRequest();
127
+ $this->stopPlugin();
128
+ return false;
129
+ }
130
+ else $url=$this->login_ok;
131
+ $res=$this->get($url,true);
132
+ if ($this->checkResponse('url_people',$res))
133
+ $this->updateDebugBuffer('url_people',$url,'GET');
134
+ else
135
+ {
136
+ $this->updateDebugBuffer('url_people',$url,'GET',false);
137
+ $this->debugRequest();
138
+ $this->stopPlugin();
139
+ return false;
140
+ }
141
+
142
+ $maxNumberContacts_bulk=$this->getElementString($res,'id="lh" class="SecondaryText">','<');
143
+ $maxNumberContacts_array=explode(" ",$maxNumberContacts_bulk);
144
+ $maxNumberContacts = 0;
145
+ foreach ($maxNumberContacts_array as $item) if (is_numeric(str_replace(')','',$item))) $maxNumberContacts = max(intval(str_replace(')','',$item)),$maxNumberContacts);
146
+
147
+ if (empty($maxNumberContacts)) return array();
148
+ $page=0;$contor=0;$contacts=array();
149
+ while ($contor<=$maxNumberContacts)
150
+ {
151
+ $page++;$contor++;;
152
+ $url_next="http://mpeople.live.com/default.aspx?pg={$page}";
153
+ if (preg_match_all("#class\=\"BoldText\" href\=\"\/contactinfo\.aspx\?contactid\=(.+)\"\>#U",$res,$matches))
154
+ {
155
+ if (!empty($matches[1]))
156
+ foreach($matches[1] as $id)
157
+ {
158
+ $name=false;$email=false;
159
+ $res=$this->get("http://mpeople.live.com/contactinfo.aspx?contactid={$id}");
160
+ if (!empty($res))
161
+ {
162
+ $name=$this->getElementString($res,'class="PageTitle">','<');
163
+ $email=$this->getElementString($res,'id="elbps">','</span>');
164
+ if ((!empty($name)) AND (!empty($email))) $contacts[$email]=array('first_name'=>$name,'email_1'=>$email);
165
+ }
166
+ }
167
+ }
168
+ $res=$this->get($url_next,true);
169
+ if ($this->checkResponse('get_contacts',$res))
170
+ $this->updateDebugBuffer('get_contacts',$url_next,'GET');
171
+ else
172
+ {
173
+ $this->updateDebugBuffer('get_contacts',$url_next,'GET',false);
174
+ $this->debugRequest();
175
+ $this->stopPlugin();
176
+ return false;
177
+ }
178
+ }
179
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
180
+ return $this->returnContacts($contacts);
181
+ }
182
+
183
+ /**
184
+ * Terminate session
185
+ *
186
+ * Terminates the current user's session,
187
+ * debugs the request and reset's the internal
188
+ * debudder.
189
+ *
190
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
191
+ */
192
+ public function logout()
193
+ {
194
+ if (!$this->checkSession()) return false;
195
+ $res=$this->get('http://mpeople.live.com/default.aspx?pg=0&PreviewScreenWidth=176',true);
196
+ $url_logout=html_entity_decode($this->getElementString($res,'<a id="SignOutLink" href="','"'));
197
+ $res=$this->get($url_logout,true);
198
+ $this->debugRequest();
199
+ $this->resetDebugger();
200
+ $this->stopPlugin();
201
+ return true;
202
+ }
203
+
204
+ }
205
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/multiply.plg.php ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Multiply
3
+ * You can Write Private Messages using Multiply system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Multiply',
7
+ 'version'=>'1.0.4',
8
+ 'description'=>"Get the contacts from a Multiply account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://multiply.com/',
12
+ 'requirement'=>'user',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Multiply Plugin
17
+ *
18
+ * Import Friends from Multiply
19
+ * You can Write Private Messages using Multiply system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class multiply extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'signin::id',
33
+ 'login_post'=>'logout',
34
+ 'get_friends'=>'contactbox',
35
+ 'url_send_message'=>'form::subject',
36
+ 'send_message'=>'Inbox'
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='multiply';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("http://multiply.com/",true);
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"http://www.multiply.com/en/",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"http://www.multiply.com/en/",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+
68
+ $form_action="http://multiply.com/user/signin";
69
+ $post_elements=$this->getHiddenElements($res);$post_elements['signin::id']=$user;$post_elements['signin::password']=$pass;$post_elements['signin::remember']='on';$post_elements['omniture_submission']='submitted';
70
+ $res=$this->post($form_action,$post_elements,true);
71
+ if ($this->checkResponse("login_post",$res))
72
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
73
+ else
74
+ {
75
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
76
+ $this->debugRequest();
77
+ $this->stopPlugin();
78
+ return false;
79
+ }
80
+
81
+ $url_contacts="http://{$user}.multiply.com/contacts";
82
+ $this->login_ok=$url_contacts;
83
+ return true;
84
+ }
85
+
86
+ /**
87
+ * Get the current user's contacts
88
+ *
89
+ * Makes all the necesarry requests to import
90
+ * the current user's contacts
91
+ *
92
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
93
+ */
94
+ public function getMyContacts()
95
+ {
96
+ if (!$this->login_ok)
97
+ {
98
+ $this->debugRequest();
99
+ $this->stopPlugin();
100
+ return false;
101
+ }
102
+ else $url=$this->login_ok;
103
+ $res=$this->get($url);
104
+ if ($this->checkResponse("get_friends",$res))
105
+ $this->updateDebugBuffer('get_friends',$url,'GET');
106
+ else
107
+ {
108
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
109
+ $this->debugRequest();
110
+ $this->stopPlugin();
111
+ return false;
112
+ }
113
+ $contacts=array();
114
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
115
+ $xpath=new DOMXPath($doc);$query="//div[@class='contactbox']";$data=$xpath->query($query);
116
+ foreach($data as $node)
117
+ {
118
+ $href=$node->firstChild->getAttribute('href');
119
+ $name=trim($this->getElementString($href,'http://','.multiply.com'));
120
+ if (!empty($href)) $contacts[$href]=utf8_decode($name);
121
+ }
122
+ return $contacts;
123
+ }
124
+
125
+ /**
126
+ * Send message to contacts
127
+ *
128
+ * Sends a message to the contacts using
129
+ * the service's inernal messaging system
130
+ *
131
+ * @param string $cookie_file The location of the cookies file for the current session
132
+ * @param string $message The message being sent to your contacts
133
+ * @param array $contacts An array of the contacts that will receive the message
134
+ * @return mixed FALSE on failure.
135
+ */
136
+ public function sendMessage($session_id,$message,$contacts)
137
+ {
138
+ $countMessages=0;
139
+ foreach($contacts as $href=>$name)
140
+ {
141
+ $countMessages++;
142
+ $send_message_url="http://multiply.com/compose/pm?individual={$name}";
143
+ $res=$this->get($send_message_url,true);
144
+ if ($this->checkResponse("url_send_message",$res))
145
+ $this->updateDebugBuffer('url_send_message',$send_message_url,'GET');
146
+ else
147
+ {
148
+ $this->updateDebugBuffer('url_send_message',$send_message_url,'GET',false);
149
+ $this->debugRequest();
150
+ $this->stopPlugin();
151
+ return false;
152
+ }
153
+
154
+ $form_action="http://multiply.com/compose/pm";
155
+ $post_elements=$this->getHiddenElements($res);$post_elements['form::subject']=$message['subject'];$post_elements['form::body']=$message['body'];$post_elements['form::Send Personal Message']=' Send Personal Message ';
156
+ $res=$this->post($form_action,$post_elements,true);
157
+ if ($this->checkResponse("send_message",$res))
158
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
159
+ else
160
+ {
161
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
162
+ $this->debugRequest();
163
+ $this->stopPlugin();
164
+ return false;
165
+ }
166
+ sleep($this->messageDelay);
167
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
168
+ }
169
+
170
+ }
171
+
172
+ /**
173
+ * Terminate session
174
+ *
175
+ * Terminates the current user's session,
176
+ * debugs the request and reset's the internal
177
+ * debudder.
178
+ *
179
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
180
+ */
181
+ public function logout()
182
+ {
183
+ if (!$this->checkSession()) return false;
184
+ $res=$this->get("http://multiply.com/user/signout");
185
+ $this->debugRequest();
186
+ $this->resetDebugger();
187
+ $this->stopPlugin();
188
+ return true;
189
+ }
190
+ }
191
+
192
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mycatspace.plg.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from mycatspace
3
+ * You can Write Private Messages using mycatspace system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Mycatspace',
7
+ 'version'=>'1.0.4',
8
+ 'description'=>"Get the contacts from a mycatspace account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.mycatspace.com/',
12
+ 'requirement'=>'user',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Mycatspace Plugin
17
+ *
18
+ * Import Friends from Mycatspace.com
19
+ * You can Write Private Messages using Mycatspace system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class mycatspace extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'username',
33
+ 'login_post'=>'/account/logout',
34
+ 'get_friends'=>'receiver_id',
35
+ 'send_message'=>'was sent'
36
+ );
37
+
38
+ /**
39
+ * Login function
40
+ *
41
+ * Makes all the necessary requests to authenticate
42
+ * the current user to the server.
43
+ *
44
+ * @param string $user The current user.
45
+ * @param string $pass The password for the current user.
46
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
47
+ */
48
+ public function login($user,$pass)
49
+ {
50
+ $this->resetDebugger();
51
+ $this->service='mycatspace';
52
+ $this->service_user=$user;
53
+ $this->service_password=$pass;
54
+ if (!$this->init()) return false;
55
+
56
+ $res=$this->get("http://www.mycatspace.com/",true);
57
+ if ($this->checkResponse("initial_get",$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.mycatspace.com/",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.mycatspace.com/",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+
67
+ $form_action="http://www.mycatspace.com/account/login";
68
+ $post_elements=array('username'=>$user,'password'=>$pass,'x'=>rand(1,100),'y'=>rand(1,100));
69
+ $res=$this->post($form_action,$post_elements,true);
70
+ if ($this->checkResponse("login_post",$res))
71
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
72
+ else
73
+ {
74
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
75
+ $this->debugRequest();
76
+ $this->stopPlugin();
77
+ return false;
78
+ }
79
+ $url_friends='http://www.mycatspace.com/email/compose';
80
+ $this->login_ok=$url_friends;
81
+ return true;
82
+ }
83
+
84
+ /**
85
+ * Get the current user's contacts
86
+ *
87
+ * Makes all the necesarry requests to import
88
+ * the current user's contacts
89
+ *
90
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
91
+ */
92
+ public function getMyContacts()
93
+ {
94
+ if (!$this->login_ok)
95
+ {
96
+ $this->debugRequest();
97
+ $this->stopPlugin();
98
+ return false;
99
+ }
100
+ else $url=$this->login_ok;
101
+ $res=$this->get($url,true);
102
+ if ($this->checkResponse("get_friends",$res))
103
+ $this->updateDebugBuffer('get_friends',$url,'GET');
104
+ else
105
+ {
106
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
107
+ $this->debugRequest();
108
+ $this->stopPlugin();
109
+ return false;
110
+ }
111
+ $contacts=array();
112
+ $names_array=$this->getElementDOM($res,'//option');
113
+ $ids_array=$this->getElementDOM($res,'//option','value');
114
+ foreach($ids_array as $key=>$value)
115
+ if (!empty($value)) $contacts[$value]=$names_array[$key];
116
+ return $contacts;
117
+ }
118
+
119
+ /**
120
+ * Send message to contacts
121
+ *
122
+ * Sends a message to the contacts using
123
+ * the service's inernal messaging system
124
+ *
125
+ * @param string $cookie_file The location of the cookies file for the current session
126
+ * @param string $message The message being sent to your contacts
127
+ * @param array $contacts An array of the contacts that will receive the message
128
+ * @return mixed FALSE on failure.
129
+ */
130
+ public function sendMessage($session_id,$message,$contacts)
131
+ {
132
+ $countMessages=0;
133
+ foreach($contacts as $id=>$name)
134
+ {
135
+ $countMessages++;
136
+ $form_action="http://www.mycatspace.com/email/compose";
137
+ $post_elements=array('email[receiver_id]'=>$id,
138
+ 'email[subject]'=>$message['subject'],
139
+ 'email[content]'=>$message['body'],
140
+ 'x'=>rand(1,100),
141
+ 'y'=>rand(1,100)
142
+ );
143
+ $res=$this->post($form_action,$post_elements,true);
144
+ if ($this->checkResponse("send_message",$res))
145
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
146
+ else
147
+ {
148
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
149
+ $this->debugRequest();
150
+ $this->stopPlugin();
151
+ return false;
152
+ }
153
+ sleep($this->messageDelay);
154
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
155
+ }
156
+
157
+ }
158
+
159
+ /**
160
+ * Terminate session
161
+ *
162
+ * Terminates the current user's session,
163
+ * debugs the request and reset's the internal
164
+ * debudder.
165
+ *
166
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
167
+ */
168
+ public function logout()
169
+ {
170
+ if (!$this->checkSession()) return false;
171
+ $res=$this->get("http://www.mycatspace.com/account/logout");
172
+ $this->debugRequest();
173
+ $this->resetDebugger();
174
+ $this->stopPlugin();
175
+ return true;
176
+ }
177
+ }
178
+
179
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mydogspace.plg.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from mydogspace
3
+ * You can Write Private Messages using mydogspace system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Mydogspace',
7
+ 'version'=>'1.0.4',
8
+ 'description'=>"Get the contacts from a mydogspace account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.mydogspace.com/',
12
+ 'requirement'=>'user',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Mydogspace Plugin
17
+ *
18
+ * Import Friends from Mydogspace.com
19
+ * You can Write Private Messages using Mydogspace system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class mydogspace extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'username',
33
+ 'login_post'=>'/account/logout',
34
+ 'get_friends'=>'receiver_id',
35
+ 'send_message'=>'was sent'
36
+ );
37
+
38
+ /**
39
+ * Login function
40
+ *
41
+ * Makes all the necessary requests to authenticate
42
+ * the current user to the server.
43
+ *
44
+ * @param string $user The current user.
45
+ * @param string $pass The password for the current user.
46
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
47
+ */
48
+ public function login($user,$pass)
49
+ {
50
+ $this->resetDebugger();
51
+ $this->service='mydogspace';
52
+ $this->service_user=$user;
53
+ $this->service_password=$pass;
54
+ if (!$this->init()) return false;
55
+
56
+ $res=$this->get("http://www.mydogspace.com/",true);
57
+ if ($this->checkResponse("initial_get",$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.mydogspace.com/",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.mydogspace.com/",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+
67
+ $form_action="http://www.mydogspace.com/account/login";
68
+ $post_elements=array('username'=>$user,'password'=>$pass,'x'=>rand(1,100),'y'=>rand(1,100));
69
+ $res=$this->post($form_action,$post_elements,true);
70
+ if ($this->checkResponse("login_post",$res))
71
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
72
+ else
73
+ {
74
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
75
+ $this->debugRequest();
76
+ $this->stopPlugin();
77
+ return false;
78
+ }
79
+ $url_friends='http://www.mydogspace.com/email/compose';
80
+ $this->login_ok=$url_friends;
81
+ return true;
82
+ }
83
+
84
+ /**
85
+ * Get the current user's contacts
86
+ *
87
+ * Makes all the necesarry requests to import
88
+ * the current user's contacts
89
+ *
90
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
91
+ */
92
+ public function getMyContacts()
93
+ {
94
+ if (!$this->login_ok)
95
+ {
96
+ $this->debugRequest();
97
+ $this->stopPlugin();
98
+ return false;
99
+ }
100
+ else $url=$this->login_ok;
101
+ $res=$this->get($url,true);
102
+ if ($this->checkResponse("get_friends",$res))
103
+ $this->updateDebugBuffer('get_friends',$url,'GET');
104
+ else
105
+ {
106
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
107
+ $this->debugRequest();
108
+ $this->stopPlugin();
109
+ return false;
110
+ }
111
+ $contacts=array();
112
+ $names_array=$this->getElementDOM($res,'//option');
113
+ $ids_array=$this->getElementDOM($res,'//option','value');
114
+ foreach($ids_array as $key=>$value)
115
+ if (!empty($value)) $contacts[$value]=$names_array[$key];
116
+ return $contacts;
117
+ }
118
+
119
+ /**
120
+ * Send message to contacts
121
+ *
122
+ * Sends a message to the contacts using
123
+ * the service's inernal messaging system
124
+ *
125
+ * @param string $cookie_file The location of the cookies file for the current session
126
+ * @param string $message The message being sent to your contacts
127
+ * @param array $contacts An array of the contacts that will receive the message
128
+ * @return mixed FALSE on failure.
129
+ */
130
+ public function sendMessage($session_id,$message,$contacts)
131
+ {
132
+ $countMessages=0;
133
+ foreach($contacts as $id=>$name)
134
+ {
135
+ $countMessages++;
136
+ $form_action="http://www.mydogspace.com/email/compose";
137
+ $post_elements=array('email[receiver_id]'=>$id,
138
+ 'email[subject]'=>$message['subject'],
139
+ 'email[content]'=>$message['body'],
140
+ 'x'=>rand(1,100),
141
+ 'y'=>rand(1,100)
142
+ );
143
+ $res=$this->post($form_action,$post_elements,true);
144
+ if ($this->checkResponse("send_message",$res))
145
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
146
+ else
147
+ {
148
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
149
+ $this->debugRequest();
150
+ $this->stopPlugin();
151
+ return false;
152
+ }
153
+ sleep($this->messageDelay);
154
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
155
+ }
156
+
157
+ }
158
+
159
+ /**
160
+ * Terminate session
161
+ *
162
+ * Terminates the current user's session,
163
+ * debugs the request and reset's the internal
164
+ * debudder.
165
+ *
166
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
167
+ */
168
+ public function logout()
169
+ {
170
+ if (!$this->checkSession()) return false;
171
+ $res=$this->get("http://www.mydogspace.com/account/logout");
172
+ $this->debugRequest();
173
+ $this->resetDebugger();
174
+ $this->stopPlugin();
175
+ return true;
176
+ }
177
+ }
178
+
179
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/mynet.plg.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Mynet.com',
4
+ 'version'=>'1.0.5',
5
+ 'description'=>"Get the contacts from an Mynet account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://uyeler.mynet.com/login/?loginRequestingURL=http%3A%2F%2Feposta.mynet.com%2Findex%2Fmymail.html&formname=eposta',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * Mynet Plugin
15
+ *
16
+ * Imports user's contacts from Mynet
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class mynet extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array('initial_get'=>'faultyUser',
29
+ 'post_login'=>'mymail',
30
+ 'url_adress'=>'adres',
31
+ 'url_file'=>'adres',
32
+ 'file_contacts'=>'Name'
33
+ );
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user, $pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='mynet';
49
+ $this->service_user=$user;
50
+ $this->service_password=$pass;
51
+ if (!$this->init()) return false;
52
+
53
+ $res = $this->get("http://uyeler.mynet.com/login/?loginRequestingURL=http%3A%2F%2Feposta.mynet.com%2Findex%2Fmymail.html&formname=eposta");
54
+ if ($this->checkResponse('initial_get',$res))
55
+ $this->updateDebugBuffer('initial_get',"http://uyeler.mynet.com/login/?loginRequestingURL=http%3A%2F%2Feposta.mynet.com%2Findex%2Fmymail.html&formname=eposta",'GET');
56
+ else
57
+ {
58
+ $this->updateDebugBuffer('initial_get',"http://uyeler.mynet.com/login/?loginRequestingURL=http%3A%2F%2Feposta.mynet.com%2Findex%2Fmymail.html&formname=eposta",'GET',false);
59
+ $this->debugRequest();
60
+ $this->stopPlugin();
61
+ return false;
62
+ }
63
+
64
+ $form_action="https://uyeler.mynet.com/index/uyegiris.html";
65
+ $post_elements=array('nameofservice'=>'epost',
66
+ 'pageURL'=>'http://uyeler.mynet.com/login/login.asp?loginRequestingURL=http%3A%2F%2Feposta.mynet.com%2Findex%2Fmymail.html&formname=eposta',
67
+ 'faultCoun'=>'',
68
+ 'faultyUser'=>'',
69
+ 'loginRequestingURL'=>'http://eposta.mynet.com/index/mymail.html',
70
+ 'rememberstate'=>2,
71
+ 'username'=>$user,
72
+ 'password'=>$pass,
73
+ 'x'=>rand(1,50),
74
+ 'y'=>rand(1,20),
75
+ 'rememberstatep'=>2
76
+ );
77
+ $res=$this->post($form_action,$post_elements,true);
78
+ if ($this->checkResponse('post_login',$res))
79
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',true,$post_elements);
80
+ else
81
+ {
82
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',false,$post_elements);
83
+ $this->debugRequest();
84
+ $this->stopPlugin();
85
+ return false;
86
+ }
87
+
88
+ $res=$this->get("http://eposta.mynet.com/index/mymail.html",true);
89
+ $base_url="http://".$this->getElementString($res,"var mySrvName = '","'").".mynet.com";
90
+ if ($this->checkResponse('url_adress',$res))
91
+ $this->updateDebugBuffer('url_adress',"http://eposta.mynet.com/index/mymail.html",'GET');
92
+ else
93
+ {
94
+ $this->updateDebugBuffer('url_adress',"http://eposta.mynet.com/index/mymail.html",'GET',false);
95
+ $this->debugRequest();
96
+ $this->stopPlugin();
97
+ return false;
98
+ }
99
+
100
+ $url_adressbook='http://adres.email'.$this->getElementString($res,'http://adres.email','"');
101
+ $res=$this->get($url_adressbook);
102
+ if ($this->checkResponse('url_file',$res))
103
+ $this->updateDebugBuffer('url_file',$url_adressbook,'GET');
104
+ else
105
+ {
106
+ $this->updateDebugBuffer('url_file',$url_adressbook,'GET',false);
107
+ $this->debugRequest();
108
+ $this->stopPlugin();
109
+ return false;
110
+ }
111
+ $url_file_contacts="http://adres.email.mynet.com/Exim/ExportFileDownload.aspx?format=microsoft_csv";
112
+ $this->login_ok=$url_file_contacts;
113
+ file_put_contents($this->getLogoutPath(),$base_url);
114
+ return true;
115
+ }
116
+
117
+ /**
118
+ * Get the current user's contacts
119
+ *
120
+ * Makes all the necesarry requests to import
121
+ * the current user's contacts
122
+ *
123
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
124
+ */
125
+ public function getMyContacts()
126
+ {
127
+ if (!$this->login_ok)
128
+ {
129
+ $this->debugRequest();
130
+ $this->stopPlugin();
131
+ return false;
132
+ }
133
+ else $url=$this->login_ok;
134
+ $res=$this->get($url);
135
+ if ($this->checkResponse('file_contacts',$res))
136
+ $this->updateDebugBuffer('file_contacts',$url,'GET');
137
+ else
138
+ {
139
+ $this->updateDebugBuffer('file_contacts',$url,'GET',false);
140
+ $this->debugRequest();
141
+ $this->stopPlugin();
142
+ return false;
143
+ }
144
+
145
+ $temp=$this->parseCSV($res);
146
+ $contacts=array();
147
+ foreach ($temp as $values)
148
+ {
149
+ if (!empty($values[9]))
150
+ $contacts[$values[9]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
151
+ 'middle_name'=>false,
152
+ 'last_name'=>(!empty($values[1])?$values[1]:false),
153
+ 'nickname'=>false,
154
+ 'email_1'=>(!empty($values[9])?$values[9]:false),
155
+ 'email_2'=>false,
156
+ 'email_3'=>false,
157
+ 'organization'=>false,
158
+ 'phone_mobile'=>(!empty($values[7])?$values[7]:false),
159
+ 'phone_home'=>(!empty($values[6])?$values[6]:false),
160
+ 'pager'=>false,
161
+ 'address_home'=>false,
162
+ 'address_city'=>false,
163
+ 'address_state'=>false,
164
+ 'address_country'=>false,
165
+ 'postcode_home'=>(!empty($values[4])?$values[4]:false),
166
+ 'company_work'=>(!empty($values[2])?$values[2]:false),
167
+ 'address_work'=>false,
168
+ 'address_work_city'=>false,
169
+ 'address_work_country'=>false,
170
+ 'address_work_state'=>false,
171
+ 'address_work_postcode'=>false,
172
+ 'fax_work'=>false,
173
+ 'phone_work'=>false,
174
+ 'website'=>false,
175
+ 'isq_messenger'=>false,
176
+ 'skype_essenger'=>false,
177
+ 'yahoo_essenger'=>false,
178
+ 'msn_messenger'=>false,
179
+ 'aol_messenger'=>false,
180
+ 'other_messenger'=>false,
181
+ );
182
+ }
183
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
184
+ return $this->returnContacts($contacts);
185
+ }
186
+
187
+ /**
188
+ * Terminate session
189
+ *
190
+ * Terminates the current user's session,
191
+ * debugs the request and reset's the internal
192
+ * debudder.
193
+ *
194
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
195
+ */
196
+ public function logout()
197
+ {
198
+ if (!$this->checkSession()) return false;
199
+ if (file_exists($this->getLogoutPath()))
200
+ {
201
+ $url_logout=file_get_contents($this->getLogoutPath())."/webmail/src/signout.php";
202
+ $res=$this->get($url_logout,true);
203
+ }
204
+ $this->debugRequest();
205
+ $this->resetDebugger();
206
+ $this->stopPlugin();
207
+ }
208
+ }
209
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/myspace.plg.php ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'MySpace',
4
+ 'version'=>'1.1.0',
5
+ 'description'=>"Get the contacts from a MySpace account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'social',
8
+ 'check_url'=>'http://www.myspace.com',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * MySpace Plugin
14
+ *
15
+ * Import user's contacts from MySpace and send
16
+ * messages using the internal messaging system
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.5
20
+ */
21
+ class myspace extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'__VIEWSTATE',
30
+ 'login'=>'Compose',
31
+ 'get_url_friends'=>'presence=ONLINE',
32
+ 'url_friends'=>'msProfileTextLink'
33
+ );
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user,$pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='myspace';
49
+ $this->service_user=$user;
50
+ $this->service_password=$pass;
51
+ if (!$this->init()) return false;
52
+
53
+ $res=$this->get("http://www.myspace.com/");
54
+ if ($this->checkResponse("initial_get",$res))
55
+ $this->updateDebugBuffer('initial_get',"http://www.myspace.com/",'GET');
56
+ else
57
+ {
58
+ $this->updateDebugBuffer('initial_get',"http://www.myspace.com/",'GET',false);
59
+ $this->debugRequest();
60
+ $this->stopPlugin();
61
+ return false;
62
+ }
63
+ $form_action="http://secure.myspace.com/index.cfm?fuseaction=login.process";
64
+ $post_elements=array('__VIEWSTATE'=>$this->getElementString($res,'id="__VIEWSTATE" value="','"'),
65
+ 'NextPage'=>'',
66
+ 'ctl00_ctl00_cpMain_cpMain_LoginBox_Email_Textbox'=>$user,
67
+ 'ctl00_ctl00_cpMain_cpMain_LoginBox_Password_Textbox'=>$pass,
68
+ 'dlb'=>'Log In',
69
+ 'ctl00_ctl00_cpMain_cpMain_LoginBox_SingleSignOnHash'=>'',
70
+ 'ctl00_ctl00_cpMain_cpMain_LoginBox_SingleSignOnRequestUri'=>'',
71
+ 'ctl00_ctl00_cpMain_cpMain_LoginBox_nexturl'=>'',
72
+ 'ctl00_ctl00_cpMain_cpMain_LoginBox_apikey'=>'',
73
+ 'ctl00_ctl00_cpMain_cpMain_LoginBox_ContainerPage'=>''
74
+ );
75
+ $res=$this->post($form_action,$post_elements,true);
76
+ if ($this->checkResponse("get_url_friends",$res))
77
+ $this->updateDebugBuffer('get_url_friends',$form_action,'POST',true,$post_elements);
78
+ else
79
+ {
80
+ $this->updateDebugBuffer('get_url_friends',$form_action,'POST',false,$post_elements);
81
+ $this->debugRequest();
82
+ $this->stopPlugin();
83
+ return false;
84
+ }
85
+ $url_friends="http://friends.myspace.com/index.cfm?fuseaction=user.viewfriends&friendID=".$this->getElementString($res,'"UserId":',',');
86
+ $this->login_ok=$url_friends;
87
+ return true;
88
+ }
89
+
90
+ /**
91
+ * Get the current user's contacts
92
+ *
93
+ * Makes all the necesarry requests to import
94
+ * the current user's contacts
95
+ *
96
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
97
+ */
98
+ public function getMyContacts()
99
+ {
100
+ if (!$this->login_ok)
101
+ {
102
+ $this->debugRequest();
103
+ $this->stopPlugin();
104
+ return false;
105
+ }
106
+ else $url=$this->login_ok;
107
+ $res=$this->get($url,true);
108
+
109
+ if ($this->checkResponse("url_friends",$res))
110
+ $this->updateDebugBuffer('url_friends',$url,'GET');
111
+ else
112
+ {
113
+ $this->updateDebugBuffer('url_friends',$url,'GET',false);
114
+ $this->debugRequest();
115
+ $this->stopPlugin();
116
+ return false;
117
+ }
118
+
119
+ $contacts=array();
120
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
121
+ $xpath=new DOMXPath($doc);$query="//a[@class='msProfileTextLink']";$data=$xpath->query($query);
122
+ foreach ($data as $node)
123
+ $contacts[str_replace('http://www.myspace.com/','',$node->getAttribute('href'))]=(string)$node->nodeValue;
124
+
125
+ return $contacts;
126
+ }
127
+
128
+ /**
129
+ * Send message to contacts
130
+ *
131
+ * Sends a message to the contacts using
132
+ * the service's inernal messaging system
133
+ *
134
+ * @param string $cookie_file The location of the cookies file for the current session
135
+ * @param string $message The message being sent to your contacts
136
+ * @param array $contacts An array of the contacts that will receive the message
137
+ * @return mixed FALSE on failure.
138
+ */
139
+ public function sendMessage($session_id,$message,$contacts)
140
+ {
141
+ $res=$this->get("http://friends.myspace.com/index.cfm?fuseaction=user.viewfriends&friendID=",true);
142
+ $mytokenvar=$this->getElementString($res,"MyToken=","')");
143
+ $countMessages=0;
144
+ foreach($contacts as $id=>$name)
145
+ {
146
+ $countMessages++;
147
+ $url_messaging="http://messaging.myspace.com/index.cfm?fuseaction=mail.message&friendID={$id}&MyToken={$mytokenvar}";
148
+ $res=$this->get($url_messaging,true);
149
+ $post_elements=array('__LASTFOCUS'=>'',
150
+ '__EVENTTARGET'=>'ctl00$ctl00$ctl00$cpMain$cpMain$messagingMain$SendMessage$btnSend',
151
+ '__EVENTARGUMENT'=>'',
152
+ '__VIEWSTATE'=>$this->getElementString($res,'id="__VIEWSTATE" value="','"'),
153
+ '___msUniqueVal'=>$this->getElementString($res,'id="___msUniqueVal" value="','"'),
154
+ 'ctl00$ctl00$ctl00$cpMain$cpMain$messagingMain$SendMessage$selectedRecipient'=>'',
155
+ 'ctl00$ctl00$ctl00$cpMain$cpMain$messagingMain$SendMessage$selectedRecipientName'=>'',
156
+ 'ctl00$ctl00$ctl00$cpMain$cpMain$messagingMain$SendMessage$subjectTextBox'=>$message['subject'],
157
+ 'ctl00$ctl00$ctl00$cpMain$cpMain$messagingMain$SendMessage$ieHack'=>'',
158
+ 'ctl00$ctl00$ctl00$cpMain$cpMain$messagingMain$SendMessage$bodyTextBox'=>$message['body'],
159
+ 'ctl00$ctl00$ctl00$cpMain$cpMain$messagingMain$SendMessage$saveDraftGuid'=>'',
160
+ 'ctl00$ctl00$ctl00$cpMain$cpMain$messagingMain$SendMessage$MessageInfoData'=>'',
161
+ 'ctl00$ctl00$ctl00$cpMain$cpMain$messagingMain$SendMessage$FriendInfoData'=>$this->getElementString($res,'id="ctl00_ctl00_ctl00_cpMain_cpMain_messagingMain_SendMessage_FriendInfoData" value="','"'),
162
+ );
163
+ $res=$this->post($url_messaging,$post_elements,true);
164
+ sleep($this->messageDelay);
165
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
166
+ }
167
+ }
168
+
169
+ /**
170
+ * Terminate session
171
+ *
172
+ * Terminates the current user's session,
173
+ * debugs the request and reset's the internal
174
+ * debudder.
175
+ *
176
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
177
+ */
178
+ public function logout()
179
+ {
180
+ if (!$this->checkSession()) return false;
181
+ $res=$this->get("http://www.myspace.com/index.cfm?fuseaction=signout",true);
182
+ $this->debugRequest();
183
+ $this->resetDebugger();
184
+ $this->stopPlugin();
185
+ return true;
186
+ }
187
+ }
188
+
189
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/netaddress.plg.php ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Netaddress',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Netaddress account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'https://www.netaddress.com/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(netaddress.com)/i'),
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * Netadress Plugin
15
+ *
16
+ * Imports user's contacts from Netaddress's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class netaddress extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array('initial_get'=>'UserID',
29
+ 'post_login'=>'Door',
30
+ 'contacts_page'=>'fileformat',
31
+ 'file_contacts'=>'Name',
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user, $pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='netaddress';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("https://www.netaddress.com/");
53
+ if ($this->checkResponse('initial_get',$res))
54
+ $this->updateDebugBuffer('initial_get',"https://www.netaddress.com/",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"https://www.netaddress.com/",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+
63
+ $form_action='https://www.netaddress.com/tpl/Door/LoginPost';
64
+ $post_elements=array('UserID'=>$user,
65
+ 'passwd'=>$pass,
66
+ 'LoginState'=>2,
67
+ 'SuccessfulLogin'=>'/tpl',
68
+ 'NewServerName'=>'www.netaddress.com',
69
+ 'JavaScript'=>'JavaScript1.2',
70
+ 'DomainID'=>$this->getElementString($res,'"DomainID" value="','"'),
71
+ 'Domain'=>$this->getElementString($res,'"Domain" value="','"')
72
+ );
73
+ $res=$this->post($form_action,$post_elements,true);
74
+ $session_id=$this->getElementString($res,'/Door/','/');
75
+ if ($this->checkResponse('post_login',$res))
76
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',true,$post_elements);
77
+ else
78
+ {
79
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',false,$post_elements);
80
+ $this->debugRequest();
81
+ $this->stopPlugin();
82
+ return false;
83
+ }
84
+ $this->login_ok=$session_id;
85
+ return true;
86
+ }
87
+
88
+ /**
89
+ * Get the current user's contacts
90
+ *
91
+ * Makes all the necesarry requests to import
92
+ * the current user's contacts
93
+ *
94
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
95
+ */
96
+ public function getMyContacts()
97
+ {
98
+ if (!$this->login_ok)
99
+ {
100
+ $this->debugRequest();
101
+ $this->stopPlugin();
102
+ return false;
103
+ }
104
+ else $id=$this->login_ok;
105
+ $url_export="http://www.netaddress.com/icalphp/exportcontact.php?sid={$id}";
106
+ $res=$this->get($url_export);
107
+ if ($this->checkResponse('contacts_page',$res))
108
+ $this->updateDebugBuffer('contacts_page',$url_export,'GET');
109
+ else
110
+ {
111
+ $this->updateDebugBuffer('contacts_page',$url_export,'GET',false);
112
+ $this->debugRequest();
113
+ $this->stopPlugin();
114
+ return false;
115
+ }
116
+
117
+ $form_action='http://www.netaddress.com/icalphp/exportcontact.php';
118
+ $post_elements=array('sid'=>$id,'fileformat'=>'csv1','csv1charset'=>'UTF-8');
119
+ $res=$this->post($form_action,$post_elements);
120
+ if ($this->checkResponse('file_contacts',$res))
121
+ $this->updateDebugBuffer('file_contacts',"{$form_action}",'POST',true,$post_elements);
122
+ else
123
+ {
124
+ $this->updateDebugBuffer('file_contacts',"{$form_action}",'POST',false,$post_elements);
125
+ $this->debugRequest();
126
+ $this->stopPlugin();
127
+ return false;
128
+ }
129
+
130
+ $temp=$this->parseCSV($res);$teM=explode(PHP_EOL,$res);$arrayDescriptionFlag=explode(',',$teM[0]);print_R($arrayDescriptionFlag);
131
+ $contacts=array();
132
+ foreach ($temp as $values)
133
+ {
134
+ $name=$values[1].(empty($values[2])?'':(empty($values[1])?'':'-')."{$values[2]}").(empty($values[3])?'':" \"{$values[3]}\"");
135
+ if (!empty($values[5]))
136
+ $contacts[$values[5]]=(empty($name)?$values[5]:$name);
137
+
138
+ if (!empty($values[5]))
139
+ $descriptionArray[$values[5]]=array('first_name'=>(!empty($values[1])?$values[0]:false),
140
+ 'middle_name'=>(!empty($values[2])?$values[2]:false),
141
+ 'last_name'=>(!empty($values[3])?$values[1]:false),
142
+ 'nickname'=>false,
143
+ 'email_1'=>(!empty($values[5])?$values[4]:false),
144
+ 'email_2'=>false,
145
+ 'email_3'=>false,
146
+ 'organization'=>false,
147
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
148
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
149
+ 'pager'=>false,
150
+ 'address_home'=>false,
151
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
152
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
153
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
154
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
155
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
156
+ 'address_work'=>false,
157
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
158
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
159
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
160
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
161
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
162
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
163
+ 'website'=>(!empty($values[12])?$values[12]:false),
164
+ 'isq_messenger'=>false,
165
+ 'skype_essenger'=>false,
166
+ 'yahoo_essenger'=>false,
167
+ 'msn_messenger'=>false,
168
+ 'aol_messenger'=>false,
169
+ 'other_messenger'=>false,
170
+ );
171
+ }
172
+
173
+ print_R($descriptionArray);
174
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
175
+ return $descriptionArray;
176
+ }
177
+
178
+ /**
179
+ * Terminate session
180
+ *
181
+ * Terminates the current user's session,
182
+ * debugs the request and reset's the internal
183
+ * debudder.
184
+ *
185
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
186
+ */
187
+ public function logout()
188
+ {
189
+ if (!$this->checkSession()) return false;
190
+ $res=$this->get('http://mail.in.com/logout',true);
191
+ $this->debugRequest();
192
+ $this->resetDebugger();
193
+ $this->stopPlugin();
194
+ }
195
+ }
196
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/netlog.plg.php ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'NetLog',
4
+ 'version'=>'1.0.6',
5
+ 'description'=>"Get the contacts from a NetLog account And Shout a message to your friends",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'social',
8
+ 'check_url'=>'http://en.netlog.com/m/login',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * Netlog Plugin
14
+ *
15
+ * Import Friends from Netlog
16
+ * You can Shouts Messages to your friends using Netlog system
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class netlog extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ protected $timeout=30;
26
+
27
+ public $debug_array=array(
28
+ 'initial_get'=>'target',
29
+ 'login_post'=>'messages',
30
+ 'get_friends'=>'option',
31
+ 'send_message'=>'success',
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user,$pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='netlog';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+ $res=$this->get('http://en.netlog.com/m/login');
52
+ if ($this->checkResponse('initial_get',$res))
53
+ $this->updateDebugBuffer('initial_get',"http://en.netlog.com/m/login",'GET');
54
+ else
55
+ {
56
+ $this->updateDebugBuffer('initial_get',"http://en.netlog.com/m/login",'GET',false);
57
+ $this->debugRequest();
58
+ $this->stopPlugin();
59
+ return false;
60
+ }
61
+
62
+ $form_action="http://en.netlog.com/m/login";
63
+ $post_elements=array('action'=>'login','target'=>$this->getElementString($res,'name="target" value="','"'),'nickname'=>$user,'password'=>$pass);
64
+ $res=$this->post($form_action,$post_elements,true,true);
65
+ if ($this->checkResponse("login_post",$res))
66
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
67
+ else
68
+ {
69
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
70
+ $this->debugRequest();
71
+ $this->stopPlugin();
72
+ return false;
73
+ }
74
+
75
+ $this->login_ok="http://en.netlog.com/m/messages/send";
76
+ return true;
77
+ }
78
+
79
+ /**
80
+ * Get the current user's contacts
81
+ *
82
+ * Makes all the necesarry requests to import
83
+ * the current user's contacts
84
+ *
85
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
86
+ */
87
+ public function getMyContacts()
88
+ {
89
+ if (!$this->login_ok)
90
+ {
91
+ $this->debugRequest();
92
+ $this->stopPlugin();
93
+ return false;
94
+ }
95
+ else $url=$this->login_ok;
96
+ $res=$this->get($url);
97
+ if ($this->checkResponse("get_friends",$res))
98
+ $this->updateDebugBuffer('get_friends',$url,'GET');
99
+ else
100
+ {
101
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
102
+ $this->debugRequest();
103
+ $this->stopPlugin();
104
+ return false;
105
+ }
106
+
107
+ $contacts=array();
108
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
109
+ $xpath=new DOMXPath($doc);$query="//option";$data=$xpath->query($query);
110
+ foreach($data as $node)
111
+ {
112
+ $user=$node->getAttribute('value');$name=$node->nodeValue;
113
+ if (strpos($name,'Album >')===false) if (!empty($user)) $contacts[$user]=$name;
114
+ }
115
+ return $contacts;
116
+ }
117
+
118
+ /**
119
+ * Send message to contacts
120
+ *
121
+ * Sends a message to the contacts using
122
+ * the service's inernal messaging system
123
+ *
124
+ * @param string $cookie_file The location of the cookies file for the current session
125
+ * @param string $message The message being sent to your contacts
126
+ * @param array $contacts An array of the contacts that will receive the message
127
+ * @return mixed FALSE on failure.
128
+ */
129
+ public function sendMessage($session_id,$message,$contacts)
130
+ {
131
+ $countMessages=0;
132
+ foreach($contacts as $user=>$name)
133
+ {
134
+ $countMessages++;
135
+ $form_action="http://en.netlog.com/m/shouts/add";
136
+ $post_elements=array('nickname'=>$user,'action'=>'__button','shout'=>$message['body'],'__btaAddShout'=>'Shout');
137
+ $res=$this->post($form_action,$post_elements,true,true);
138
+ if (strpos($res,'warning')===false)
139
+ if ($this->checkResponse("send_message",$res))
140
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
141
+ else
142
+ {
143
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
144
+ $this->debugRequest();
145
+ $this->stopPlugin();
146
+ return false;
147
+ }
148
+ sleep($this->messageDelay);
149
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
150
+ }
151
+ }
152
+
153
+ /**
154
+ * Terminate session
155
+ *
156
+ * Terminates the current user's session,
157
+ * debugs the request and reset's the internal
158
+ * debudder.
159
+ *
160
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
161
+ */
162
+ public function logout()
163
+ {
164
+ if (!$this->checkSession()) return false;
165
+ $logout_url = "http://en.netlog.com/m/login/action=logout";
166
+ $res = $this->get($logout_url);
167
+ $this->debugRequest();
168
+ $this->resetDebugger();
169
+ $this->stopPlugin();
170
+ }
171
+ }
172
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/ning.plg.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from ning
3
+ * You can Update your status using ning system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Ning',
7
+ 'version'=>'1.0.1',
8
+ 'description'=>"Get the contacts from a ning account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.ning.com/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Ning Plugin
17
+ *
18
+ * Import Friends from Ning
19
+ * You can Write Private Messages using Brazencareerist system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class ning extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'signin_password',
33
+ 'login_post'=>'xn_signout',
34
+ 'get_friends'=>'tb',
35
+ 'send_message'=>'200 '
36
+ );
37
+
38
+ /**
39
+ * Login function
40
+ *
41
+ * Makes all the necessary requests to authenticate
42
+ * the current user to the server.
43
+ *
44
+ * @param string $user The current user.
45
+ * @param string $pass The password for the current user.
46
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
47
+ */
48
+ public function login($user,$pass)
49
+ {
50
+ $this->resetDebugger();
51
+ $this->service='ning';
52
+ $this->service_user=$user;
53
+ $this->service_password=$pass;
54
+
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("http://www.ning.com/main/signin",true);
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"http://www.brazencareerist.com/",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"http://www.brazencareerist.com/",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+
68
+ $form_action="https://www.ning.com/main/signin?area=System_SignIn";
69
+ $post_elements=array('target'=>'http://www.ning.com/',
70
+ 'emailAddress'=>$user,
71
+ 'password'=>$pass,
72
+ );
73
+ $res=$this->post($form_action,$post_elements,true);
74
+ if ($this->checkResponse("login_post",$res))
75
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
76
+ else
77
+ {
78
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
79
+ $this->debugRequest();
80
+ $this->stopPlugin();
81
+ return false;
82
+ }
83
+ $url_friends='http://www.ning.com/'.$this->getElementString($res,'id="xn_username">','<')."/friends";
84
+ $this->login_ok=$url_friends;
85
+ return true;
86
+ }
87
+
88
+ /**
89
+ * Get the current user's contacts
90
+ *
91
+ * Makes all the necesarry requests to import
92
+ * the current user's contacts
93
+ *
94
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
95
+ */
96
+ public function getMyContacts()
97
+ {
98
+ if (!$this->login_ok)
99
+ {
100
+ $this->debugRequest();
101
+ $this->stopPlugin();
102
+ return false;
103
+ }
104
+ else $url=$this->login_ok;
105
+ $res=$this->get($url,true);
106
+ if ($this->checkResponse("get_friends",$res))
107
+ $this->updateDebugBuffer('get_friends',$url,'GET');
108
+ else
109
+ {
110
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
111
+ $this->debugRequest();
112
+ $this->stopPlugin();
113
+ return false;
114
+ }
115
+
116
+ $contacts=array();
117
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
118
+ $xpath=new DOMXPath($doc);$query="//div[@class='tb']";$data=$xpath->query($query);
119
+ foreach($data as $node)
120
+ {
121
+ $name=$node->childNodes->item(1)->nodeValue;
122
+ if (!empty($name)) $contacts[$name]=$name;
123
+ }
124
+ return $contacts;
125
+ }
126
+
127
+ /**
128
+ * Send message to contacts
129
+ *
130
+ * Sends a message to the contacts using
131
+ * the service's inernal messaging system
132
+ *
133
+ * @param string $cookie_file The location of the cookies file for the current session
134
+ * @param string $message The message being sent to your contacts
135
+ * @param array $contacts An array of the contacts that will receive the message
136
+ * @return mixed FALSE on failure.
137
+ */
138
+ public function sendMessage($session_id,$message,$contacts)
139
+ {
140
+ $res=$this->get("http://www.ning.com");
141
+ $form_action="http://www.ning.com/main/ajax?area=Status";
142
+ $post_elements=array("status"=>$message['body'],'xp_token'=>$this->getElementString($res,'"xp_token" value="','"'));
143
+ $res=$this->post($form_action,$post_elements,true);
144
+ }
145
+
146
+ /**
147
+ * Terminate session
148
+ *
149
+ * Terminates the current user's session,
150
+ * debugs the request and reset's the internal
151
+ * debudder.
152
+ *
153
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
154
+ */
155
+ public function logout()
156
+ {
157
+ if (!$this->checkSession()) return false;
158
+ $res=$this->get("http://www.ning.com/main/signout");
159
+ $this->debugRequest();
160
+ $this->resetDebugger();
161
+ $this->stopPlugin();
162
+ return true;
163
+ }
164
+ }
165
+
166
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/nz11.plg.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Nz11',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Nz11 account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://nz11.com/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Netadress Plugin
15
+ *
16
+ * Imports user's contacts from Netaddress's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class nz11 extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array('initial_get'=>'loginName',
29
+ 'post_login'=>'oi_sda_firstname',
30
+ 'contacts_page'=>'entriesPerPage2',
31
+ 'all_contacts'=>'entriesPerPage2',
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user, $pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='nz11';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("http://nz11.mail.everyone.net/email/scripts/loginuser.pl");
53
+ if ($this->checkResponse('initial_get',$res))
54
+ $this->updateDebugBuffer('initial_get',"http://nz11.mail.everyone.net/email/scripts/loginuser.pl",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"http://nz11.mail.everyone.net/email/scripts/loginuser.pl",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+ $form_action='http://nz11.mail.everyone.net/email/scripts/loginuser.pl?'.$this->getElementString($res,' name="myForm" method="post" action="loginuser.pl?','"');
63
+ $post_elements=array('loginName'=>$user,'user_pwd'=>$pass,'login'=>'Login');
64
+ $res=$this->post($form_action,$post_elements,true);
65
+ if ($this->checkResponse('post_login',$res))
66
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',true,$post_elements);
67
+ else
68
+ {
69
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',false,$post_elements);
70
+ $this->debugRequest();
71
+ $this->stopPlugin();
72
+ return false;
73
+ }
74
+ $this->login_ok='http://nz11.mail.everyone.net/email/scripts/contacts.pl';
75
+ return true;
76
+ }
77
+
78
+ /**
79
+ * Get the current user's contacts
80
+ *
81
+ * Makes all the necesarry requests to import
82
+ * the current user's contacts
83
+ *
84
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
85
+ */
86
+ public function getMyContacts()
87
+ {
88
+ if (!$this->login_ok)
89
+ {
90
+ $this->debugRequest();
91
+ $this->stopPlugin();
92
+ return false;
93
+ }
94
+ else $url=$this->login_ok;
95
+ $res=$this->get($url);
96
+ if ($this->checkResponse('contacts_page',$res))
97
+ $this->updateDebugBuffer('contacts_page',$url,'GET');
98
+ else
99
+ {
100
+ $this->updateDebugBuffer('contacts_page',$url,'GET',false);
101
+ $this->debugRequest();
102
+ $this->stopPlugin();
103
+ return false;
104
+ }
105
+ $form_action='http://nz11.mail.everyone.net/email/scripts/contacts.pl';
106
+ $post_elements=$this->getHiddenElements($res);$post_elements['entriesPerPage2']='All';
107
+ $res=$this->post($form_action,$post_elements);
108
+ if ($this->checkResponse('all_contacts',$res))
109
+ $this->updateDebugBuffer('all_contacts',"{$form_action}",'POST',true,$post_elements);
110
+ else
111
+ {
112
+ $this->updateDebugBuffer('all_contacts',"{$form_action}",'POST',false,$post_elements);
113
+ $this->debugRequest();
114
+ $this->stopPlugin();
115
+ return false;
116
+ }
117
+
118
+ $contacts=array();$contacts_bulk="";
119
+ $contacts_array=$this->getElementDOM($res,"//a",'href');
120
+ foreach ($contacts_array as $contacts_string)
121
+ if (strpos($contacts_string,'javascript:composeMe')!==false)
122
+ {
123
+ $contacts_bulk=$this->getElementString($contacts_string,"'",'>');
124
+ $contacts_bulk=str_replace('"','',$contacts_bulk);
125
+ $contacts_explode=explode('<',$contacts_bulk);
126
+ if (isset($contacts_explode[1]))
127
+ $contacts[$contacts_explode[1]]=array('first_name'=>(isset($contacts_explode[0])?$contacts_explode[0]:false),'email_1'=>$contacts_explode[1]);
128
+ }
129
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
130
+ return $this->returnContacts($contacts);
131
+ }
132
+
133
+ /**
134
+ * Terminate session
135
+ *
136
+ * Terminates the current user's session,
137
+ * debugs the request and reset's the internal
138
+ * debudder.
139
+ *
140
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
141
+ */
142
+ public function logout()
143
+ {
144
+ if (!$this->checkSession()) return false;
145
+ $res=$this->get('http://nz11.mail.everyone.net/email/scripts/logout.pl');
146
+ $this->debugRequest();
147
+ $this->resetDebugger();
148
+ $this->stopPlugin();
149
+ }
150
+ }
151
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/o2.plg.php ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'O2',
4
+ 'version'=>'1.0.2',
5
+ 'description'=>"Get the contacts from a O2 account",
6
+ 'base_version'=>'1.6.9',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://poczta.o2.pl/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * O2 Plugin
15
+ *
16
+ * Imports user's contacts from O2's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class o2 extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'login',
30
+ 'post_login'=>'ssid',
31
+ 'url_webinterface'=>'kbshortcut',
32
+ 'url_get_webinterface'=>'kbshortcut',
33
+ 'contacts_page'=>'MSignal_UA-Download*',
34
+ 'contacts_file'=>'Title',
35
+ );
36
+
37
+ /**
38
+ * Login function
39
+ *
40
+ * Makes all the necessary requests to authenticate
41
+ * the current user to the server.
42
+ *
43
+ * @param string $user The current user.
44
+ * @param string $pass The password for the current user.
45
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
46
+ */
47
+ public function login($user,$pass)
48
+ {
49
+ $this->resetDebugger();
50
+ $this->service='o2';
51
+ $this->service_user=$user;
52
+ $this->service_password=$pass;
53
+ if (!$this->init()) return false;
54
+
55
+ $res=$this->get("http://poczta.o2.pl/");
56
+ if ($this->checkResponse('initial_get',$res))
57
+ $this->updateDebugBuffer('initial_get',"http://www.fastmail.fm/",'GET');
58
+ else
59
+ {
60
+ $this->updateDebugBuffer('initial_get',"http://www.fastmail.fm/",'GET',false);
61
+ $this->debugRequest();
62
+ $this->stopPlugin();
63
+ return false;
64
+ }
65
+
66
+ $form_action="https://poczta.o2.pl/login.html";
67
+ $post_elements=array('username'=>$user,'password'=>$pass,'ssl'=>'login','x'=>rand(1,100),'y'=>rand(1,100));
68
+ $res=$this->post($form_action,$post_elements,false,true,false,array(),false,false);
69
+ if ($this->checkResponse('post_login',$res))
70
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',true,$post_elements);
71
+ else
72
+ {
73
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',false,$post_elements);
74
+ $this->debugRequest();
75
+ $this->stopPlugin();
76
+ return false;
77
+ }
78
+ $sesid=$this->getElementString($res,'ssid=',";");
79
+ $url_export="http://poczta.o2.pl/a?cmd=export_addressbook&requestid=2&xsfr-cookie={$sesid}&fmt=xml&upid=&";
80
+ $this->login_ok=$url_export;
81
+ return true;
82
+ }
83
+
84
+ /**
85
+ * Get the current user's contacts
86
+ *
87
+ * Makes all the necesarry requests to import
88
+ * the current user's contacts
89
+ *
90
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
91
+ */
92
+ public function getMyContacts()
93
+ {
94
+ if (!$this->login_ok)
95
+ {
96
+ $this->debugRequest();
97
+ $this->stopPlugin();
98
+ return false;
99
+ }
100
+ else $url=$this->login_ok;
101
+ $res=$this->post($url,array('outputformat'=>'outlook'));
102
+ $temp=$this->parseCSV($res);
103
+ $contacts=array();
104
+ foreach ($temp as $values)
105
+ {
106
+ if (!empty($values[11]))
107
+ $descriptionArray[$values[11]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
108
+ 'middle_name'=>(!empty($values[1])?$values[1]:false),
109
+ 'last_name'=>(!empty($values[3])?$values[3]:false),
110
+ 'nickname'=>(!empty($values[6])?$values[6]:false),
111
+ 'email_1'=>(!empty($values[11])?$values[11]:false),
112
+ 'email_2'=>(!empty($values[4])?$values[4]:false),
113
+ 'email_3'=>false,
114
+ 'organization'=>false,
115
+ 'phone_mobile'=>(!empty($values[6])?$values[6]:false),
116
+ 'phone_home'=>(!empty($values[8])?$values[8]:false),
117
+ 'pager'=>(!empty($values[12])?$values[12]:false),
118
+ 'address_home'=>false,
119
+ 'address_city'=>false,
120
+ 'address_state'=>false,
121
+ 'address_country'=>false,
122
+ 'postcode_home'=>false,
123
+ 'company_work'=>false,
124
+ 'address_work'=>false,
125
+ 'address_work_city'=>false,
126
+ 'address_work_country'=>false,
127
+ 'address_work_state'=>false,
128
+ 'address_work_postcode'=>false,
129
+ 'fax_work'=>false,
130
+ 'phone_work'=>(!empty($values[13])?$values[13]:false),
131
+ 'website'=>(!empty($values[9])?$values[9]:false),
132
+ 'isq_messenger'=>false,
133
+ 'skype_essenger'=>false,
134
+ 'yahoo_essenger'=>false,
135
+ 'msn_messenger'=>false,
136
+ 'aol_messenger'=>false,
137
+ 'other_messenger'=>false,
138
+ );
139
+ }
140
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
141
+ return $this->returnContacts($contacts);
142
+ }
143
+
144
+ /**
145
+ * Terminate session
146
+ *
147
+ * Terminates the current user's session,
148
+ * debugs the request and reset's the internal
149
+ * debudder.
150
+ *
151
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
152
+ */
153
+ public function logout()
154
+ {
155
+ if (!$this->checkSession()) return false;
156
+ if (file_exists($this->getLogoutPath()))
157
+ {
158
+ $url=file_get_contents($this->getLogoutPath());
159
+ //go to url adress book url in order to make the logout
160
+ $res=$this->get($url,true);
161
+ $form_action=$this->getElementString($res,'action="','"');
162
+ $post_elements=$this->getHiddenElements($res);
163
+ $post_elements['MSignal_AD-LGO*C-1.N-1']='Logout';
164
+
165
+ //get the post elements and make de logout
166
+ $res=$this->post($form_action,$post_elements,true);
167
+ }
168
+ $this->debugRequest();
169
+ $this->resetDebugger();
170
+ $this->stopPlugin();
171
+ return true;
172
+ }
173
+
174
+ }
175
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/operamail.plg.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'OperaMail',
4
+ 'version'=>'1.0.7',
5
+ 'description'=>"Get the contacts from an OperaMail account",
6
+ 'base_version'=>'1.6.0',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.operamail.com',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(operamail.com)/i'),
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * OperaMail Plugin
15
+ *
16
+ * Import user's contacts from OperaMail
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.4
20
+ */
21
+ class operamail extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $requirement='email';
26
+ public $internalError=false;
27
+ protected $timeout=30;
28
+ public $allowed_domains=array('operamail');
29
+
30
+ public $debug_array=array(
31
+ 'initial_get'=>'login',
32
+ 'login_post'=>'main?.ob',
33
+ 'file_contacts'=>'"'
34
+ );
35
+
36
+ /**
37
+ * Login function
38
+ *
39
+ * Makes all the necessary requests to authenticate
40
+ * the current user to the server.
41
+ *
42
+ * @param string $user The current user.
43
+ * @param string $pass The password for the current user.
44
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
45
+ */
46
+ public function login($user,$pass)
47
+ {
48
+ $this->resetDebugger();
49
+ $this->service='operamail';
50
+ $this->service_user=$user;
51
+ $this->service_password=$pass;
52
+ if (!$this->init()) return false;
53
+
54
+ $res=$this->get("http://www.operamail.com/scripts/common/index.main?signin=1&lang=us",true);
55
+ if ($this->checkResponse("initial_get",$res))
56
+ $this->updateDebugBuffer('initial_get',"http://www.operamail.com/scripts/common/index.main?signin=1&lang=us",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get',"http://www.operamail.com/scripts/common/index.main?signin=1&lang=us",'GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+ $form_action="http://www.operamail.com/scripts/common/proxy.main";
65
+ $post_elements=$this->getHiddenElements($res);$post_elements['login']=$user;$post_elements['password']=$pass;
66
+ $res=$this->post($form_action,$post_elements,true);
67
+ if ($this->checkResponse("login_post",$res))
68
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
69
+ else
70
+ {
71
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
72
+ $this->debugRequest();
73
+ $this->stopPlugin();
74
+ return false;
75
+ }
76
+
77
+ $url_file_contacts="http://mymail.operamail.com/scripts/addr/external.cgi?.ob=&gab=1";
78
+ $this->login_ok=$url_file_contacts;
79
+ return true;
80
+ }
81
+
82
+ /**
83
+ * Get the current user's contacts
84
+ *
85
+ * Makes all the necesarry requests to import
86
+ * the current user's contacts
87
+ *
88
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
89
+ */
90
+ public function getMyContacts()
91
+ {
92
+ if (!$this->login_ok)
93
+ {
94
+ $this->debugRequest();
95
+ $this->stopPlugin();
96
+ return false;
97
+ }
98
+ else $url=$this->login_ok;
99
+
100
+ $form_action=$url;
101
+ $post_elements=array('showexport'=>'showexport',
102
+ 'action'=>'export',
103
+ 'login'=>$this->service_user,
104
+ 'format'=>'csv'
105
+ );
106
+ $res=$this->post($form_action,$post_elements);
107
+
108
+ if ($this->checkResponse("file_contacts",$res))
109
+ $this->updateDebugBuffer('file_contacts',$form_action,'POST',true,$post_elements);
110
+ else
111
+ {
112
+ $this->updateDebugBuffer('file_contacts',$form_action,'POST',false,$post_elements);
113
+ $this->debugRequest();
114
+ $this->stopPlugin();
115
+ return false;
116
+ }
117
+ $temp=$this->parseCSV($res);
118
+ $contacts=array();
119
+ foreach ($temp as $values)
120
+ {
121
+ if (!empty($values[4]))
122
+ $contacts[$values[4]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
123
+ 'middle_name'=>(!empty($values[1])?$values[1]:false),
124
+ 'last_name'=>(!empty($values[2])?$values[1]:false),
125
+ 'nickname'=>(!empty($values[3])?$values[3]:false),
126
+ 'email_1'=>(!empty($values[4])?$values[4]:false),
127
+ 'email_2'=>(!empty($values[12])?$values[12]:false),
128
+ 'email_3'=>(!empty($values[13])?$values[13]:false),
129
+ 'organization'=>false,
130
+ 'phone_mobile'=>(!empty($values[10])?$values[10]:false),
131
+ 'phone_home'=>(!empty($values[6])?$values[6]:false),
132
+ 'pager'=>(!empty($values[8])?$values[8]:false),
133
+ 'address_home'=>false,
134
+ 'address_city'=>(!empty($values[28])?$values[28]:false),
135
+ 'address_state'=>(!empty($values[29])?$values[29]:false),
136
+ 'address_country'=>(!empty($values[31])?$values[31]:false),
137
+ 'postcode_home'=>(!empty($values[30])?$values[30]:false),
138
+ 'company_work'=>(!empty($values[17])?$values[17]:false),
139
+ 'address_work'=>false,
140
+ 'address_work_city'=>(!empty($values[21])?$values[21]:false),
141
+ 'address_work_country'=>(!empty($values[24])?$values[24]:false),
142
+ 'address_work_state'=>(!empty($values[22])?$values[22]:false),
143
+ 'address_work_postcode'=>(!empty($values[23])?$values[23]:false),
144
+ 'fax_work'=>false,
145
+ 'phone_work'=>(!empty($values[7])?$values[7]:false),
146
+ 'website'=>false,
147
+ 'isq_messenger'=>false,
148
+ 'skype_essenger'=>false,
149
+ 'yahoo_essenger'=>false,
150
+ 'msn_messenger'=>false,
151
+ 'aol_messenger'=>false,
152
+ 'other_messenger'=>false,
153
+ );
154
+ }
155
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
156
+ return $this->returnContacts($contacts);
157
+ }
158
+
159
+ /**
160
+ * Terminate session
161
+ *
162
+ * Terminates the current user's session,
163
+ * debugs the request and reset's the internal
164
+ * debudder.
165
+ *
166
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
167
+ */
168
+ public function logout()
169
+ {
170
+ if (!$this->checkSession()) return false;
171
+ $url_logout="http://mymail.operamail.com/scripts/mail/Outblaze.mail?logout=1&.noframe=1&a=1&";
172
+ $res=$this->get($url_logout,true);
173
+ $this->debugRequest();
174
+ $this->resetDebugger();
175
+ $this->stopPlugin();
176
+ return true;
177
+ }
178
+
179
+ }
180
+
181
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/orkut.plg.php ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Orkut',
4
+ 'version'=>'1.1.6',
5
+ 'description'=>"Get the contacts from an Orkut account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'social',
8
+ 'check_url'=>'http://www.orkut.com/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ class orkut extends openinviter_base
13
+ {
14
+ private $login_ok=false;
15
+ public $showContacts=true;
16
+ protected $timeout=30;
17
+
18
+ public $debug_array=array(
19
+ 'secondary_get'=>'Email:',
20
+ 'login_post'=>'url=&#39;',
21
+ 'url_redirect'=>'mblock',
22
+ 'url_friends'=>'mblock',
23
+ 'url_send_message'=>'scrapText',
24
+ );
25
+
26
+ public function login($user,$pass)
27
+ {
28
+ $this->resetDebugger();
29
+ $this->service='orkut';
30
+ $this->service_user=$user;
31
+ $this->service_password=$pass;
32
+ if (!$this->init()) return false;
33
+ $res=$this->get("http://m.orkut.com/",true);
34
+ if ($this->checkResponse('secondary_get',$res))
35
+ $this->updateDebugBuffer('secondary_get',"http://www.orkut.com/",'GET');
36
+ else
37
+ {
38
+ $this->updateDebugBuffer('secondary_get',"http://www.orkut.com/",'GET',false);
39
+ $this->debugRequest();
40
+ $this->stopPlugin();
41
+ return false;
42
+ }
43
+
44
+ $postAction = "https://www.google.com/accounts/ServiceLoginAuth?service=orkut";
45
+ $postElem = $this->getHiddenElements($res);
46
+ $postElem["Email"] = $user;
47
+ $postElem["Passwd"]= $pass;
48
+ $res=$this->post($postAction,$postElem,true);
49
+ if ($this->checkResponse("login_post",$res))
50
+ $this->updateDebugBuffer('login_post',$postAction,'POST',true,$postElem);
51
+ else
52
+ {
53
+ $this->updateDebugBuffer('login_post',$postAction,'POST',false,$postElem);
54
+ $this->debugRequest();
55
+ $this->stopPlugin();
56
+ return false;
57
+ }
58
+
59
+
60
+ $url_redirect=html_entity_decode($this->getElementString($res,'url=&#39;','&#39;'));
61
+ $res=$this->get($url_redirect,true);
62
+
63
+ if (strpos($res,'url=&#39;')!==false)
64
+ {
65
+ $url_redirect=html_entity_decode($this->getElementString($res,'url=&#39;','&#39;'));
66
+ $res=$this->get($url_redirect,true);
67
+ }
68
+ if ($this->checkResponse('url_redirect',$res))
69
+ $this->updateDebugBuffer('url_redirect',"http://www.orkut.com/",'GET');
70
+ else
71
+ {
72
+ $this->updateDebugBuffer('url_redirect',"http://www.orkut.com/",'GET',false);
73
+ $this->debugRequest();
74
+ $this->stopPlugin();
75
+ return false;
76
+ }
77
+ $this->login_ok = "http://m.orkut.com/Friends";
78
+ return true;
79
+ }
80
+
81
+ public function getMyContacts()
82
+ {
83
+ if (!$this->login_ok)
84
+ {
85
+ $this->debugRequest();
86
+ $this->stopPlugin();
87
+ return false;
88
+ }
89
+ else $url = $this->login_ok;
90
+ $originalLink = array(
91
+ "a"=>"http://m.orkut.com/ShowFriends?small=a&caps=A&pgsize=10000",
92
+ "b"=>"http://m.orkut.com/ShowFriends?small=b&caps=B&pgsize=10000",
93
+ "c"=>"http://m.orkut.com/ShowFriends?small=c&caps=C&pgsize=10000",
94
+ "d"=>"http://m.orkut.com/ShowFriends?small=d&caps=D&pgsize=10000",
95
+ "e"=>"http://m.orkut.com/ShowFriends?small=e&caps=E&pgsize=10000",
96
+ "f"=>"http://m.orkut.com/ShowFriends?small=f&caps=F&pgsize=10000",
97
+ "g"=>"http://m.orkut.com/ShowFriends?small=g&caps=G&pgsize=10000",
98
+ "h"=>"http://m.orkut.com/ShowFriends?small=h&caps=H&pgsize=10000",
99
+ "i"=>"http://m.orkut.com/ShowFriends?small=i&caps=I&pgsize=10000",
100
+ "j"=>"http://m.orkut.com/ShowFriends?small=j&caps=J&pgsize=10000",
101
+ "k"=>"http://m.orkut.com/ShowFriends?small=k&caps=K&pgsize=10000",
102
+ "l"=>"http://m.orkut.com/ShowFriends?small=l&caps=L&pgsize=10000",
103
+ "m"=>"http://m.orkut.com/ShowFriends?small=m&caps=M&pgsize=10000",
104
+ "n"=>"http://m.orkut.com/ShowFriends?small=n&caps=N&pgsize=10000",
105
+ "o"=>"http://m.orkut.com/ShowFriends?small=o&caps=O&pgsize=10000",
106
+ "p"=>"http://m.orkut.com/ShowFriends?small=p&caps=P&pgsize=10000",
107
+ "q"=>"http://m.orkut.com/ShowFriends?small=q&caps=Q&pgsize=10000",
108
+ "r"=>"http://m.orkut.com/ShowFriends?small=r&caps=R&pgsize=10000",
109
+ "s"=>"http://m.orkut.com/ShowFriends?small=s&caps=S&pgsize=10000",
110
+ "t"=>"http://m.orkut.com/ShowFriends?small=t&caps=T&pgsize=10000",
111
+ "u"=>"http://m.orkut.com/ShowFriends?small=u&caps=U&pgsize=10000",
112
+ "v"=>"http://m.orkut.com/ShowFriends?small=v&caps=V&pgsize=10000",
113
+ "w"=>"http://m.orkut.com/ShowFriends?small=w&caps=W&pgsize=10000",
114
+ "x"=>"http://m.orkut.com/ShowFriends?small=x&caps=X&pgsize=10000",
115
+ "y"=>"http://m.orkut.com/ShowFriends?small=y&caps=Y&pgsize=10000",
116
+ "z"=>"http://m.orkut.com/ShowFriends?small=z&caps=Z&pgsize=10000",
117
+ "*"=>"http://m.orkut.com/ShowFriends?small=*&caps=*&pgsize=10000"
118
+ );
119
+
120
+ $contacts=array();
121
+ foreach($originalLink as $link)
122
+ {
123
+ $res=$this->get($link,true);
124
+ if ($this->checkResponse('url_friends',$res))
125
+ $this->updateDebugBuffer('url_friends',$link,'GET');
126
+ else
127
+ {
128
+ $this->updateDebugBuffer('url_friends',$link,'GET',false);
129
+ $this->debugRequest();
130
+ $this->stopPlugin();
131
+ return false;
132
+ }
133
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
134
+ $xpath=new DOMXPath($doc);$query="//div[@class='mblock']";$data=$xpath->query($query);
135
+ foreach ($data as $node)
136
+ {
137
+ $firstChild=$node->childNodes->item(1);
138
+ if (isset($firstChild)) if ($firstChild->nodeName=='a') if (strpos((string)$firstChild->getAttribute('href'),'/FullProfile?uid=')!==false)
139
+ {
140
+ $id=str_replace('/FullProfile?uid=','',(string)$firstChild->getAttribute('href'));$name=trim(preg_replace('/[^(\x20-\x7F)]*/','',(string)$firstChild->nodeValue));
141
+ if (!empty($id)) $contacts[$id]=$name;
142
+ }
143
+ }
144
+ }
145
+ return $contacts;
146
+ }
147
+
148
+ /**
149
+ * Send message to contacts
150
+ *
151
+ * Sends a message to the contacts using
152
+ * the service's inernal messaging system
153
+ *
154
+ * @param string $cookie_file The location of the cookies file for the current session
155
+ * @param string $message The message being sent to your contacts
156
+ * @param array $contacts An array of the contacts that will receive the message
157
+ * @return mixed FALSE on failure.
158
+ */
159
+ public function sendMessage($session_id,$message,$contacts)
160
+ {
161
+ $countMessages=0;
162
+ foreach($contacts as $id=>$name)
163
+ {
164
+ $countMessages++;
165
+ $url_scrap="http://m.orkut.com/Scrapbook?uid={$id}";
166
+ $res=$this->get($url_scrap);
167
+ if ($this->checkResponse("url_send_message",$res))
168
+ $this->updateDebugBuffer('url_send_message',$url_scrap,'GET');
169
+ else
170
+ {
171
+ $this->updateDebugBuffer('url_send_message',$url_scrap,'GET',false);
172
+ $this->debugRequest();
173
+ $this->stopPlugin();
174
+ return false;
175
+ }
176
+
177
+ $form_action="http://m.orkut.com/Scrapbook";
178
+ $post_elements=$this->getHiddenElements($res);$post_elements['scrapText']=str_replace(array('.','&'),'~',$message['body']);
179
+ $res=$this->post($form_action,$post_elements,true);
180
+ sleep($this->messageDelay);
181
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
182
+ }
183
+ }
184
+
185
+ /**
186
+ * Terminate session
187
+ *
188
+ * Terminates the current user's session,
189
+ * debugs the request and reset's the internal
190
+ * debudder.
191
+ *
192
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
193
+ */
194
+ public function logout()
195
+ {
196
+ if (!$this->checkSession()) return false;
197
+ $logout_url = "http://www.orkut.com/GLogin.aspx?cmd=logout";
198
+ $res = $this->get($logout_url);
199
+ $this->debugRequest();
200
+ $this->resetDebugger();
201
+ $this->stopPlugin();
202
+ return true;
203
+ }
204
+ }
205
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/perfspot.plg.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Perfspot
3
+ * You can send private message using Perfspot system to your Friends
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Perfspot',
7
+ 'version'=>'1.0.7',
8
+ 'description'=>"Get the contacts from a Perfspot account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://m.perfspot.com/index.asp',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Perfspot Plugin
17
+ *
18
+ * Imports user's contacts from Perfspot and send messages
19
+ * using Perfspot's internal system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.6
23
+ */
24
+ class perfspot extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'txtEmail',
33
+ 'post_login'=>'accesskey="7"',
34
+ 'url_menu'=>'class="name"',
35
+ 'url_friend'=>'accesskey="4"',
36
+ 'url_send_message'=>'Title',
37
+ 'send_message'=>'color: Red;'
38
+ );
39
+
40
+ /**
41
+ * Login function
42
+ *
43
+ * Makes all the necessary requests to authenticate
44
+ * the current user to the server.
45
+ *
46
+ * @param string $user The current user.
47
+ * @param string $pass The password for the current user.
48
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
49
+ */
50
+ public function login($user,$pass)
51
+ {
52
+ $this->resetDebugger();
53
+ $this->service='perfspot';
54
+ $this->service_user=$user;
55
+ $this->service_password=$pass;
56
+ if (!$this->init()) return false;
57
+
58
+ $res=$this->get("http://m.perfspot.com/index.asp");
59
+ if ($this->checkResponse('initial_get',$res))
60
+ $this->updateDebugBuffer('initial_get',"http://m.perfspot.com/index.asp",'GET');
61
+ else
62
+ {
63
+ $this->updateDebugBuffer('initial_get',"http://m.perfspot.com/index.asp",'GET',false);
64
+ $this->debugRequest();
65
+ $this->stopPlugin();
66
+ return false;
67
+ }
68
+ $form_action="http://m.perfspot.com/index.asp";
69
+ $post_elements=array('txtEmail'=>$user,
70
+ 'txtPassword'=>$pass,
71
+ 'LoginButton'=>'Login'
72
+ );
73
+ $res=$this->post($form_action,$post_elements,true);
74
+ if ($this->checkResponse('post_login',$res))
75
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',true,$post_elements);
76
+ else
77
+ {
78
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',false,$post_elements);
79
+ $this->debugRequest();
80
+ $this->stopPlugin();
81
+ return false;
82
+ }
83
+
84
+ $url_menu_array=$this->getElementDOM($res,"//a[@accesskey='7']",'href');
85
+ $url_menu="http://m.perfspot.com/".$url_menu_array[0];
86
+ $this->login_ok=$url_menu;
87
+ return true;
88
+ }
89
+
90
+ /**
91
+ * Get the current user's contacts
92
+ *
93
+ * Makes all the necesarry requests to import
94
+ * the current user's contacts
95
+ *
96
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
97
+ */
98
+ public function getMyContacts()
99
+ {
100
+ if (!$this->login_ok)
101
+ {
102
+ $this->debugRequest();
103
+ $this->stopPlugin();
104
+ return false;
105
+ }
106
+ else $url=$this->login_ok;
107
+ $res=$this->get($url);
108
+
109
+ $url_contacts_array=$this->getElementDOM($res,"//a[@accesskey='3']",'href');
110
+ $url_contacts="http://m.perfspot.com/".$url_contacts_array[0];
111
+ $res=$this->get($url_contacts);
112
+ if ($this->checkResponse('url_menu',$res))
113
+ $this->updateDebugBuffer('url_menu',$url,'GET');
114
+ else
115
+ {
116
+ $this->updateDebugBuffer('url_menu',$url,'GET',false);
117
+ $this->debugRequest();
118
+ $this->stopPlugin();
119
+ return false;
120
+ }
121
+
122
+ $contacts=array();
123
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
124
+ $xpath=new DOMXPath($doc);$query="//a[@class='name']";$data=$xpath->query($query);
125
+ foreach($data as $node)
126
+ $contacts[$node->getAttribute('href')]=$node->nodeValue;
127
+ return $contacts;
128
+ }
129
+
130
+ /**
131
+ * Send message to contacts
132
+ *
133
+ * Sends a message to the contacts using
134
+ * the service's inernal messaging system
135
+ *
136
+ * @param string $session_id The OpenInviter user's session ID
137
+ * @param string $message The message being sent to your contacts
138
+ * @param array $contacts An array of the contacts that will receive the message
139
+ * @return mixed FALSE on failure.
140
+ */
141
+ public function sendMessage($session_id,$message,$contacts)
142
+ {
143
+ $countMessages=0;
144
+ foreach($contacts as $href=>$name)
145
+ {
146
+ $countMessages++;
147
+ $url_friend=html_entity_decode("http://m.perfspot.com/{$href}");
148
+ $res=$this->get($url_friend);
149
+ if ($this->checkResponse('url_friend',$res))
150
+ $this->updateDebugBuffer('url_friend',$url_friend,'GET');
151
+ else
152
+ {
153
+ $this->updateDebugBuffer('url_friend',$url_friend,'GET',false);
154
+ $this->debugRequest();
155
+ $this->stopPlugin();
156
+ return false;
157
+ }
158
+
159
+ $url_message_array=$this->getElementDOM($res,"//a[@accesskey='4']",'href');
160
+ $url_message="http://m.perfspot.com/".$url_message_array[0];
161
+ $res=$this->get($url_message);
162
+ if ($this->checkResponse('url_send_message',$res))
163
+ $this->updateDebugBuffer('url_send_message',$url_message,'GET');
164
+ else
165
+ {
166
+ $this->updateDebugBuffer('url_send_message',$url_message,'GET',false);
167
+ $this->debugRequest();
168
+ $this->stopPlugin();
169
+ return false;
170
+ }
171
+ $form_action="http://m.perfspot.com/".$this->getElementString($res,'action="','"');
172
+ $post_elements=array('Title'=>$message['subject'],'txtMessage'=>$message['body'],'btnSend'=>'Send');
173
+ $res=$this->post($form_action,$post_elements,true);
174
+ if ($this->checkResponse('send_message',$res))
175
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
176
+ else
177
+ {
178
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
179
+ $this->debugRequest();
180
+ $this->stopPlugin();
181
+ return false;
182
+ }
183
+ sleep($this->messageDelay);
184
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
185
+ }
186
+ }
187
+
188
+ /**
189
+ * Terminate session
190
+ *
191
+ * Terminates the current user's session,
192
+ * debugs the request and reset's the internal
193
+ * debudder.
194
+ *
195
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
196
+ */
197
+ public function logout()
198
+ {
199
+ if (!$this->checkSession()) return false;
200
+ $res=$this->get("http://m.perfspot.com/index.asp?mode=logout");
201
+ $this->debugRequest();
202
+ $this->resetDebugger();
203
+ $this->stopPlugin();
204
+ return true;
205
+
206
+ }
207
+ }
208
+
209
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/plaxo.plg.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Plaxo',
4
+ 'version'=>'1.0.7',
5
+ 'description'=>"Get the contacts from a plaxo account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'social',
8
+ 'check_url'=>'http://m.plaxo.com',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * plaxo.com Plugin
14
+ *
15
+ * Imports user's contacts from plaxo.com's AddressBook
16
+ *
17
+ * @author OpenInviter
18
+ * @version 1.4.7
19
+ */
20
+ class plaxo extends openinviter_base
21
+ {
22
+ private $login_ok=false;
23
+ public $showContacts=true;
24
+ public $debug_array=array(
25
+ 'initial_check'=>'Welcome',
26
+ );
27
+
28
+ /**
29
+ * Login function
30
+ *
31
+ * Makes all the necessary requests to authenticate
32
+ * the current user to the server.
33
+ *
34
+ * @param string $user The current user.c
35
+ * @param string $pass The password for the current user.
36
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
37
+ */
38
+ public function login($user,$pass)
39
+ {
40
+ $this->resetDebugger();
41
+ $this->service='plaxo';
42
+ $this->service_user=$user;
43
+ $this->service_password=$pass;
44
+ if (!$this->init()) return false;
45
+ $postAction = "http://m.plaxo.com/index.php?page=login";
46
+ $postElem['email']=$user;
47
+ $postElem['password']=$pass;
48
+ $res = $this->post($postAction, $postElem, true);
49
+ if ($this->checkResponse("initial_check",$res))
50
+ $this->updateDebugBuffer('initial_check',$postAction,'POST');
51
+ else
52
+ {
53
+ $this->updateDebugBuffer('initial_check',$postAction,'POST',false);
54
+ $this->debugRequest();
55
+ $this->stopPlugin();
56
+ return false;
57
+ }
58
+ $this->login_ok = "http://m.plaxo.com/?page=contacts";
59
+ return true;
60
+ }
61
+
62
+ /**
63
+ * Get the current user's contacts
64
+ *
65
+ * Makes all the necesarry requests to import
66
+ * the current user's contacts
67
+ *
68
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
69
+ */
70
+ public function getMyContacts()
71
+ {
72
+ if (!$this->login_ok)
73
+ {
74
+ $this->debugRequest();
75
+ $this->stopPlugin();
76
+ return false;
77
+ }
78
+ else
79
+ $url=$this->login_ok;
80
+ $contacts = array();
81
+ //Thanks to ROBOV99 for the pagination code
82
+ $boolContinue = true;
83
+ $inti =1;
84
+ while($boolContinue)
85
+ {
86
+ $res=$this->get($url,true);
87
+ $res = $this->getElementString($res, "</p>", "</div>");
88
+ $res.="//exit//";
89
+ $iCntThisPage =0;
90
+ while(stripos($res,'<a href="') !== false)
91
+ {
92
+ $res = $this->getElementString($res, '<a href="','//exit//');
93
+ $mail = $this->getElementString($res, '&amp;id=','">');
94
+ $contactstemp[$mail] = $this->getElementString($res,'">','</a>');
95
+ if (strlen($mail) >2) $iCntThisPage++;
96
+ $res.="//exit//";
97
+ }
98
+ if (0== $iCntThisPage) break;
99
+ $strBegin = "http://m.plaxo.com/?page=contacts&pageNum=";
100
+ $inti = $inti + 1;
101
+ $url = $strBegin.$inti;
102
+ }
103
+ if (!empty($contactstemp))
104
+ foreach ($contactstemp as $id=>$name)
105
+ {
106
+ $res = $this->get("http://m.plaxo.com/?page=contact&id=".$id,true);
107
+ $mail = $this->getElementString($res,'mailto:','"');
108
+ unset($contacts[$id]);
109
+ $contacts[$mail]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$mail);
110
+ }
111
+ foreach ($contacts as $email=>$name)
112
+ { if (!$this->isEmail($email)) unset($contacts[$email]); }
113
+ return $this->returnContacts($contacts);
114
+ }
115
+
116
+ /**
117
+ * Terminate session
118
+ *
119
+ * Terminates the current user's session,
120
+ * debugs the request and reset's the internal
121
+ * debugger.
122
+ *
123
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
124
+ */
125
+ public function logout()
126
+ {
127
+ if (!$this->checkSession()) return false;
128
+ $res = $this->get('http://m.plaxo.com/index.php?page=logout', true);
129
+ $this->debugRequest();
130
+ $this->resetDebugger();
131
+ $this->stopPlugin();
132
+ return true;
133
+ }
134
+
135
+ }
136
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/plazes.plg.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Plazes
3
+ * You can Write Private Messages using Plazes system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Plazes',
7
+ 'version'=>'1.0.3',
8
+ 'description'=>"Get the contacts from a Plazes account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.plazes.com/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Plazes Plugin
17
+ *
18
+ * Import Friends from Plazes
19
+ * You can Write Private Messages using Plazes system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class plazes extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'login',
33
+ 'login_post'=>'sign_out',
34
+ 'get_friends'=>'vcard',
35
+ 'send_message'=>'sent'
36
+ );
37
+
38
+ /**
39
+ * Login function
40
+ *
41
+ * Makes all the necessary requests to authenticate
42
+ * the current user to the server.
43
+ *
44
+ * @param string $user The current user.
45
+ * @param string $pass The password for the current user.
46
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
47
+ */
48
+ public function login($user,$pass)
49
+ {
50
+ $this->resetDebugger();
51
+ $this->service='plazes';
52
+ $this->service_user=$user;
53
+ $this->service_password=$pass;
54
+ if (!$this->init()) return false;
55
+
56
+ $res=$this->get("http://plazes.com/",true);
57
+ if ($this->checkResponse("initial_get",$res))
58
+ $this->updateDebugBuffer('initial_get',"http://www.plazes.com/en/",'GET');
59
+ else
60
+ {
61
+ $this->updateDebugBuffer('initial_get',"http://www.plazes.com/en/",'GET',false);
62
+ $this->debugRequest();
63
+ $this->stopPlugin();
64
+ return false;
65
+ }
66
+
67
+ $form_action="http://plazes.com/sessions";
68
+ $post_elements=array('return_to'=>'/',
69
+ 'login'=>$user,
70
+ 'password'=>$pass,
71
+ 'remember_me'=>1,
72
+ );
73
+ $res=$this->post($form_action,$post_elements,true);
74
+ if ($this->checkResponse("login_post",$res))
75
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
76
+ else
77
+ {
78
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
79
+ $this->debugRequest();
80
+ $this->stopPlugin();
81
+ return false;
82
+ }
83
+ $url_friends='http://plazes.com/manage/contacts';
84
+ $this->login_ok=$url_friends;
85
+ return true;
86
+ }
87
+
88
+ /**
89
+ * Get the current user's contacts
90
+ *
91
+ * Makes all the necesarry requests to import
92
+ * the current user's contacts
93
+ *
94
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
95
+ */
96
+ public function getMyContacts()
97
+ {
98
+ if (!$this->login_ok)
99
+ {
100
+ $this->debugRequest();
101
+ $this->stopPlugin();
102
+ return false;
103
+ }
104
+ else $url=$this->login_ok;
105
+ $res=$this->get($url);
106
+ if ($this->checkResponse("get_friends",$res))
107
+ $this->updateDebugBuffer('get_friends',$url,'GET');
108
+ else
109
+ {
110
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
111
+ $this->debugRequest();
112
+ $this->stopPlugin();
113
+ return false;
114
+ }
115
+
116
+ $contacts=array();
117
+ $names_array=$this->getElementDOM($res,"//a[@rel='vcard']");
118
+ $hrefs_array=$this->getElementDOM($res,"//a[@rel='vcard']",'href');
119
+ if (!empty($hrefs_array))
120
+ foreach($hrefs_array as $key=>$value)
121
+ {
122
+ $id=str_replace('/users/','',$value);
123
+ $contacts[$id]=(!empty($names_array[$key])?$names_array[$key]:false);
124
+ }
125
+ return $contacts;
126
+ }
127
+
128
+ /**
129
+ * Send message to contacts
130
+ *
131
+ * Sends a message to the contacts using
132
+ * the service's inernal messaging system
133
+ *
134
+ * @param string $cookie_file The location of the cookies file for the current session
135
+ * @param string $message The message being sent to your contacts
136
+ * @param array $contacts An array of the contacts that will receive the message
137
+ * @return mixed FALSE on failure.
138
+ */
139
+ public function sendMessage($session_id,$message,$contacts)
140
+ {
141
+ $countMessages=0;
142
+ foreach($contacts as $id=>$name)
143
+ {
144
+ $countMessages++;
145
+ $form_action="http://plazes.com/messages";
146
+ $post_elements=array('message[recipient_id]'=>$id,
147
+ 'message[body]'=>$message['body'],
148
+ 'return_to'=>"/users/{$id}"
149
+ );
150
+ $res=$this->post($form_action,$post_elements,true);
151
+ if ($this->checkResponse("send_message",$res))
152
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
153
+ else
154
+ {
155
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
156
+ $this->debugRequest();
157
+ $this->stopPlugin();
158
+ return false;
159
+ }
160
+ sleep($this->messageDelay);
161
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
162
+ }
163
+
164
+ }
165
+
166
+ /**
167
+ * Terminate session
168
+ *
169
+ * Terminates the current user's session,
170
+ * debugs the request and reset's the internal
171
+ * debudder.
172
+ *
173
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
174
+ */
175
+ public function logout()
176
+ {
177
+ if (!$this->checkSession()) return false;
178
+ $res=$this->get("http://www.plazes.com/en/logout/");
179
+ $this->debugRequest();
180
+ $this->resetDebugger();
181
+ $this->stopPlugin();
182
+ return true;
183
+ }
184
+ }
185
+
186
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/plurk.plg.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Plurk',
4
+ 'version'=>'1.0.7',
5
+ 'description'=>"Get the contacts from a Plurk account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'social',
8
+ 'check_url'=>'http://www.plurk.com/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * Plurk Plugin
14
+ *
15
+ * Imports user's contacts from Plurk and
16
+ * .
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.3
20
+ */
21
+ class plurk extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=false;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'nick_name',
30
+ 'login'=>'user_id',
31
+ 'get_contacts'=>'nick_name',
32
+ 'send_message'=>'"error": null'
33
+ );
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user,$pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='plurk';
49
+ $this->service_user=$user;
50
+ $this->service_password=$pass;
51
+ if (!$this->init()) return false;
52
+
53
+ $res=$this->get("http://www.plurk.com/");
54
+ if ($this->checkResponse("initial_get",$res))
55
+ $this->updateDebugBuffer('initial_get',"http://www.plurk.com/",'GET');
56
+ else
57
+ {
58
+ $this->updateDebugBuffer('initial_get',"http://www.plurk.com/",'GET',false);
59
+ $this->debugRequest();
60
+ $this->stopPlugin();
61
+ return false;
62
+ }
63
+
64
+ $form_action='http://www.plurk.com/Users/login';
65
+ $post_elements=array('nick_name'=>$user,'password'=>$pass);
66
+ $res=$this->post($form_action,$post_elements,true);
67
+ if ($this->checkResponse("login",$res))
68
+ $this->updateDebugBuffer('login',$form_action,'POST',true,$post_elements);
69
+ else
70
+ {
71
+ $this->updateDebugBuffer('login',$form_action,'POST',false,$post_elements);
72
+ $this->debugRequest();
73
+ $this->stopPlugin();
74
+ return false;
75
+ }
76
+
77
+ $user_id=$this->getElementString($res,'"user_id": ',',');
78
+ $this->login_ok=$is->login_ok=$user_id;
79
+ return true;
80
+ }
81
+
82
+ /**
83
+ * Get the current user's contacts
84
+ *
85
+ * Makes all the necesarry requests to import
86
+ * the current user's contacts
87
+ *
88
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
89
+ */
90
+ public function getMyContacts()
91
+ {
92
+ if (!$this->login_ok)
93
+ {
94
+ $this->debugRequest();
95
+ $this->stopPlugin();
96
+ return false;
97
+ }
98
+ else $user_id=$this->login_ok;
99
+ $url_request_friends="http://www.plurk.com/Friends/getFriendsByOffset";
100
+ $post_elements=array('offset'=>0,'user_id'=>$user_id);
101
+ $res=$this->post($url_request_friends,$post_elements,true);
102
+ if ($this->checkResponse("get_contacts",$res))
103
+ $this->updateDebugBuffer('get_contacts',$url_request_friends,'POST',true,$post_elements);
104
+ else
105
+ {
106
+ $this->updateDebugBuffer('get_contacts',$url_request_friends,'POST',false,$post_elements);
107
+ $this->debugRequest();
108
+ $this->stopPlugin();
109
+ return false;
110
+ }
111
+
112
+ $contacts=array();
113
+ while(strpos($res,'"nick_name": "')!==false)
114
+ {
115
+ $name=$this->getElementString($res,'"nick_name": "','"');
116
+ $name_delete='"nick_name": "'.$name;
117
+ $uid=$this->getElementString($res,'"uid": ',',');
118
+ $uid_delete='"uid": '.$uid;
119
+ $res=str_replace($name_delete,'',str_replace($uid_delete,'',$res));
120
+ if(isset($uid)) $contacts[$uid]=(isset($name)?$name:false);
121
+ }
122
+ return $contacts;
123
+ }
124
+
125
+ /**
126
+ * Send message to contacts
127
+ *
128
+ * Sends a message to the contacts using
129
+ * the service's inernal messaging system
130
+ *
131
+ * @param string $cookie_file The location of the cookies file for the current session
132
+ * @param string $message The message being sent to your contacts
133
+ * @param array $contacts An array of the contacts that will receive the message
134
+ * @return mixed FALSE on failure.
135
+ */
136
+ public function sendMessage($session_id,$message,$contacts)
137
+ {
138
+ $res=$this->get('http://www.plurk.com',true);
139
+ $user_id=$this->getElementString($res,'"user_id": ',',');
140
+ $form_action="http://www.plurk.com/TimeLine/addPlurk";
141
+ $post_elements=array('posted'=>'%222009-1-12T14%3A18%3A30%22',
142
+ 'qualifier'=>'is',
143
+ 'content'=>$message['body'],
144
+ 'lang'=>'en',
145
+ 'no_comments'=>0,
146
+ 'uid'=>$user_id
147
+ );
148
+ $res=$this->post($form_action,$post_elements,true);
149
+ if ($this->checkResponse("send_message",$res))
150
+ $this->updateDebugBuffer('send_message',$form_action,'POST',true,$post_elements);
151
+ else
152
+ {
153
+ $this->updateDebugBuffer('send_message',$form_action,'POST',false,$post_elements);
154
+ $this->debugRequest();
155
+ $this->stopPlugin();
156
+ return false;
157
+ }
158
+
159
+ }
160
+
161
+ /**
162
+ * Terminate session
163
+ *
164
+ * Terminates the current user's session,
165
+ * debugs the request and reset's the internal
166
+ * debudder.
167
+ *
168
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
169
+ */
170
+ public function logout()
171
+ {
172
+ if (!$this->checkSession()) return false;
173
+ $res=$this->get("http://www.plurk.com/Users/logout",true);
174
+ $this->debugRequest();
175
+ $this->resetDebugger();
176
+ $this->stopPlugin();
177
+ return true;
178
+ }
179
+ }
180
+
181
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/pochta.plg.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Pochta',
4
+ 'version'=>'1.0.3',
5
+ 'description'=>"Get the contacts from a Pochta account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.pochta.ru/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * Pochta Plugin
15
+ *
16
+ * Imports user's contacts from Pochta AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class pochta extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'user',
30
+ 'login_post'=>'inbox',
31
+ 'url_export'=>',"',
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user,$pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='pochta';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("http://www.pochta.ru/");
53
+ if ($this->checkResponse("initial_get",$res))
54
+ $this->updateDebugBuffer('initial_get',"http://www.pochta.ru/",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"http://www.pochta.ru/",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+
63
+ $user_array=explode('@',$user);$username=$user_array[0];$domain=$user_array[1];
64
+ $form_action="http://www.pochta.ru/auth/logon";
65
+ $post_elements=array('reason'=>'login','back'=>false,'lng'=>'ru','user'=>$username,'domain'=>$domain,'pass'=>$pass,'long_session'=>1);
66
+ $res=$this->post($form_action,$post_elements,true);
67
+ if ($this->checkResponse('login_post',$res))
68
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
69
+ else
70
+ {
71
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
72
+ $this->debugRequest();
73
+ $this->stopPlugin();
74
+ return false;
75
+ }
76
+
77
+ $this->login_ok="http://www.pochta.ru/adb/export/?export_type=outlook&export_action=export";
78
+ return true;
79
+ }
80
+
81
+ /**
82
+ * Get the current user's contacts
83
+ *
84
+ * Makes all the necesarry requests to import
85
+ * the current user's contacts
86
+ *
87
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
88
+ */
89
+ public function getMyContacts()
90
+ {
91
+ if (!$this->login_ok)
92
+ {
93
+ $this->debugRequest();
94
+ $this->stopPlugin();
95
+ return false;
96
+ }
97
+ else $url=$this->login_ok;
98
+ $res=$this->get($url);
99
+ if ($this->checkResponse("url_export",$res))
100
+ $this->updateDebugBuffer('url_export',$url,'GET');
101
+ else
102
+ {
103
+ $this->updateDebugBuffer('url_export',$url,'GET',false);
104
+ $this->debugRequest();
105
+ $this->stopPlugin();
106
+ return false;
107
+ }
108
+ $contacts=array();
109
+ $temp=$this->parseCSV($res);$teM=explode(PHP_EOL,$res);$arrayDescriptionFlag=explode(',',$teM[0]);print_R($arrayDescriptionFlag);
110
+ foreach ($temp as $values)
111
+ {
112
+ if (!empty($values[82]))
113
+ $contacts[$values[4]]=array('first_name'=>(!empty($values[1])?$values[1]:false),
114
+ 'middle_name'=>(!empty($values[2])?$values[2]:false),
115
+ 'last_name'=>false,
116
+ 'nickname'=>false,
117
+ 'email_1'=>(!empty($values[82])?$values[82]:false),
118
+ 'email_2'=>false,
119
+ 'email_3'=>false,
120
+ 'organization'=>false,
121
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
122
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
123
+ 'pager'=>false,
124
+ 'address_home'=>false,
125
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
126
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
127
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
128
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
129
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
130
+ 'address_work'=>false,
131
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
132
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
133
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
134
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
135
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
136
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
137
+ 'website'=>(!empty($values[12])?$values[12]:false),
138
+ 'isq_messenger'=>false,
139
+ 'skype_essenger'=>false,
140
+ 'yahoo_essenger'=>false,
141
+ 'msn_messenger'=>false,
142
+ 'aol_messenger'=>false,
143
+ 'other_messenger'=>false,
144
+ );
145
+ }
146
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
147
+ return $this->returnContacts($contacts);
148
+ }
149
+
150
+ /**
151
+ * Terminate session
152
+ *
153
+ * Terminates the current user's session,
154
+ * debugs the request and reset's the internal
155
+ * debudder.
156
+ *
157
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
158
+ */
159
+ public function logout()
160
+ {
161
+ if (!$this->checkSession()) return false;
162
+ $res=$this->get('http://www.pochta.ru/auth/logout/',true);
163
+ $this->debugRequest();
164
+ $this->resetDebugger();
165
+ $this->stopPlugin();
166
+ return true;
167
+ }
168
+
169
+ }
170
+
171
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/popstarmail.plg.php ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Popstarmail',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from an Popstarmail account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://super.popstarmail.org/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * popstarmail Plugin
15
+ *
16
+ * Imports user's contacts from popstarmail's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class popstarmail extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ protected $timeout=30;
25
+ public $showContacts=true;
26
+ public $debug_array=array(
27
+ 'initial_get'=>'show_frame',
28
+ 'login_post'=>'ob',
29
+ 'get_contacts'=>'showexport',
30
+ 'contacts_file'=>'Name'
31
+ );
32
+
33
+ /**
34
+ * Login function
35
+ *
36
+ * Makes all the necessary requests to authenticate
37
+ * the current user to the server.
38
+ *
39
+ * @param string $user The current user.
40
+ * @param string $pass The password for the current user.
41
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
42
+ */
43
+ public function login($user,$pass)
44
+ {
45
+ $this->resetDebugger();
46
+ $this->service='popstarmail';
47
+ $this->service_user=$user;
48
+ $this->service_password=$pass;
49
+ if (!$this->init()) return false;
50
+ $res=$this->get("http://super.popstarmail.org/",true);
51
+ if ($this->checkResponse('initial_get',$res))
52
+ $this->updateDebugBuffer('initial_get',"http://super.popstarmail.org/",'GET');
53
+ else
54
+ {
55
+ $this->updateDebugBuffer('initial_get',"http://super.popstarmail.org/",'GET',false);
56
+ $this->debugRequest();
57
+ $this->stopPlugin();
58
+ return false;
59
+ }
60
+
61
+ $form_action="http://super.popstarmail.org/scripts/common/ss_main.cgi";
62
+ $post_elements=array('show_frame'=>'Enter','action'=>'login','login'=>$user,'password'=>$pass,'x'=>rand(5,15),'y'=>rand(5,15));
63
+ $res=$this->post($form_action,$post_elements,true);
64
+ if ($this->checkResponse("login_post",$res))
65
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
66
+ else
67
+ {
68
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
69
+ $this->debugRequest();
70
+ $this->stopPlugin();
71
+ return false;
72
+ }
73
+
74
+ $sid=$this->getElementString($res,'ob=','"');
75
+ $url_export="http://mymail.hk.popstarmail.org/scripts/addr/external.cgi?.ob={$sid}&gab=1";
76
+ $this->login_ok=$url_export;
77
+ return true;
78
+ }
79
+
80
+ /**
81
+ * Get the current user's contacts
82
+ *
83
+ * Makes all the necesarry requests to import
84
+ * the current user's contacts
85
+ *
86
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
87
+ */
88
+ public function getMyContacts()
89
+ {
90
+ if (!$this->login_ok)
91
+ {
92
+ $this->debugRequest();
93
+ $this->stopPlugin();
94
+ return false;
95
+ }
96
+ else $url = $this->login_ok;
97
+ $res=$this->get($url);
98
+ if ($this->checkResponse('get_contacts',$res))
99
+ $this->updateDebugBuffer('get_contacts',"http://www.evite.com/loginRegForm?redirect=/pages/addrbook/contactList.jsp",'GET');
100
+ else
101
+ {
102
+ $this->updateDebugBuffer('get_contacts',"http://www.evite.com/loginRegForm?redirect=/pages/addrbook/contactList.jsp",'GET',false);
103
+ $this->debugRequest();
104
+ $this->stopPlugin();
105
+ return false;
106
+ }
107
+
108
+ $form_action=$url;
109
+ $post_elements=array('showexport'=>'showexport','action'=>'export','login'=>$this->service_user,'format'=>'csv');
110
+ $res=$this->post($form_action,$post_elements);
111
+ if ($this->checkResponse("contacts_file",$res))
112
+ $this->updateDebugBuffer('contacts_file',$form_action,'POST',true,$post_elements);
113
+ else
114
+ {
115
+ $this->updateDebugBuffer('contacts_file',$form_action,'POST',false,$post_elements);
116
+ $this->debugRequest();
117
+ $this->stopPlugin();
118
+ return false;
119
+ }
120
+ $temp=$this->parseCSV($res);
121
+ $contacts=array();
122
+ foreach ($temp as $values)
123
+ {
124
+ if (!empty($values[4]))
125
+ $contacts[$values[4]]=array('first_name'=>(!empty($values[0])?$values[0]:false),
126
+ 'middle_name'=>(!empty($values[2])?$values[2]:false),
127
+ 'last_name'=>(!empty($values[1])?$values[1]:false),
128
+ 'nickname'=>false,
129
+ 'email_1'=>(!empty($values[4])?$values[4]:false),
130
+ 'email_2'=>false,
131
+ 'email_3'=>false,
132
+ 'organization'=>false,
133
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
134
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
135
+ 'pager'=>false,
136
+ 'address_home'=>false,
137
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
138
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
139
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
140
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
141
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
142
+ 'address_work'=>false,
143
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
144
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
145
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
146
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
147
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
148
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
149
+ 'website'=>(!empty($values[12])?$values[12]:false),
150
+ 'isq_messenger'=>false,
151
+ 'skype_essenger'=>false,
152
+ 'yahoo_essenger'=>false,
153
+ 'msn_messenger'=>false,
154
+ 'aol_messenger'=>false,
155
+ 'other_messenger'=>false,
156
+ );
157
+ }
158
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
159
+ return $this->returnContacts($contacts);
160
+ }
161
+
162
+
163
+ /**
164
+ * Terminate session
165
+ *
166
+ * Terminates the current user's session,
167
+ * debugs the request and reset's the internal
168
+ * debudder.
169
+ *
170
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
171
+ */
172
+ public function logout()
173
+ {
174
+ if (!$this->checkSession()) return false;
175
+ $logout_url="http://mymail.hk.popstarmail.org/scripts/mail/Outblaze.mail?logout=1&.noframe=1&a=1&";
176
+ $res = $this->get($logout_url,true);
177
+ $this->debugRequest();
178
+ $this->resetDebugger();
179
+ $this->stopPlugin();
180
+ return true;
181
+ }
182
+ }
183
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/rambler.plg.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Rambler',
4
+ 'version'=>'1.1.6',
5
+ 'description'=>"Get the contacts from a Rambler account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.rambler.ru',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(rambler.ru)/i'),
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Rambler Plugin
15
+ *
16
+ * Import user's contacts from Rambler AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.9
20
+ */
21
+ class rambler extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'login',
30
+ 'login_post'=>'ramac_add_handler',
31
+ 'url_contacts'=>'email'
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user,$pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='rambler';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("http://www.rambler.ru/",true);
53
+
54
+ if ($this->checkResponse("initial_get",$res))
55
+ $this->updateDebugBuffer('initial_get',"http://www.rambler.ru/",'GET');
56
+ else
57
+ {
58
+ $this->updateDebugBuffer('initial_get',"http://www.rambler.ru/",'GET',false);
59
+ $this->debugRequest();
60
+ $this->stopPlugin();
61
+ return false;
62
+ }
63
+ $post_elements=$this->getHiddenElements($res);$post_elements['login']=$user;$post_elements['passw']=$pass;
64
+ unset($post_elements[0]);
65
+ $res=$this->post("http://id.rambler.ru/script/auth.cgi",$post_elements,true);
66
+ if ($this->checkResponse("login_post",$res))
67
+ $this->updateDebugBuffer('login_post',"http://id.rambler.ru/script/auth.cgi",'POST',true,$post_elements);
68
+ else
69
+ {
70
+ $this->updateDebugBuffer('login_post',"http://id.rambler.ru/script/auth.cgi",'POST',false,$post_elements);
71
+ $this->debugRequest();
72
+ $this->stopPlugin();
73
+ return false;
74
+ }
75
+
76
+ $url_contact_array=$this->getElementDOM($res,"//a[@id='addressbook-link']",'href');
77
+ $value=substr($url_contact_array[0],strpos($url_contact_array[0],"r=")+2,strlen($url_contact_array[0])-strpos($url_contact_array[0],"r=")-2);
78
+ $url_contact="http://mail.rambler.ru/mail/contacts.cgi?r={$value}";
79
+ $this->login_ok=$url_contact;
80
+ file_put_contents($this->getLogoutPath(),$value);
81
+ return true;
82
+ }
83
+
84
+ /**
85
+ * Get the current user's contacts
86
+ *
87
+ * Makes all the necesarry requests to import
88
+ * the current user's contacts
89
+ *
90
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
91
+ */
92
+ public function getMyContacts()
93
+ {
94
+ if (!$this->login_ok)
95
+ {
96
+ $this->debugRequest();
97
+ $this->stopPlugin();
98
+ return false;
99
+ }
100
+ else $url=$this->login_ok;
101
+ $res=$this->get($url,true);
102
+ if ($this->checkResponse("url_contacts",$res))
103
+ $this->updateDebugBuffer('url_contacts',$url,'GET');
104
+ else
105
+ {
106
+ $this->updateDebugBuffer('url_contacts',$url,'GET',false);
107
+ $this->debugRequest();
108
+ $this->stopPlugin();
109
+ return false;
110
+ }
111
+ $contacts=array();
112
+ $emailsArray=$this->getElementDOM($res,"//a[@class='email']");
113
+ $namesArray=$this->getElementDOM($res,"//td[@class='org ']");
114
+ if (!empty($emailsArray))
115
+ foreach($emailsArray as $key=>$emailValue) $contacts[$emailValue]=array('first_name'=>(isset($namesArray[$key])?$namesArray[$key]:false),'email_1'=>$emailValue);
116
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
117
+ return $this->returnContacts($contacts);
118
+ }
119
+
120
+ /**
121
+ * Terminate session
122
+ *
123
+ * Terminates the current user's session,
124
+ * debugs the request and reset's the internal
125
+ * debudder.
126
+ *
127
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
128
+ */
129
+ public function logout()
130
+ {
131
+ if (!$this->checkSession()) return false;
132
+ if (file_exists($this->getLogoutPath()))
133
+ {
134
+ $url_logout="http://id.rambler.ru/script/auth.cgi?back=;mode=logout;r=".file_get_contents($this->getLogoutPath());
135
+ $res=$this->get($url_logout,true);
136
+ }
137
+ $this->debugRequest();
138
+ $this->resetDebugger();
139
+ $this->stopPlugin();
140
+ return true;
141
+ }
142
+ }
143
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/rediff.plg.php ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Rediff',
4
+ 'version'=>'1.2.1',
5
+ 'description'=>"Get the contacts from a Rediff account",
6
+ 'base_version'=>'1.8.1',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://mail.rediff.com',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Rediff Plugin
15
+ *
16
+ * Import user's contacts from Rediff's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.1.6
20
+ */
21
+ class rediff extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ private $sess_id, $username, $siteAddr;
26
+ public $debug_array=array(
27
+ 'login_post'=>'window.location.replace',
28
+ 'url_contacts'=>'var session_id',
29
+ 'url_contacts_form'=>'els',
30
+ 'file_contacts'=>'Name',
31
+ );
32
+
33
+ /**
34
+ * Login function
35
+ *
36
+ * Makes all the necessary requests to authenticate
37
+ * the current user to the server.
38
+ *
39
+ * @param string $user The current user.
40
+ * @param string $pass The password for the current user.
41
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
42
+ */
43
+ public function login($user,$pass)
44
+ {
45
+ $this->resetDebugger();
46
+ $this->service='rediff';
47
+ $this->service_user=$user;
48
+ $this->service_password=$pass;
49
+ if (!$this->init()) return false;
50
+ $post_elements=array("login"=>"{$user}",
51
+ "passwd"=>"{$pass}",
52
+ "FormName"=>"existing");
53
+ $res=htmlentities($this->post("http://mail.rediff.com/cgi-bin/login.cgi",$post_elements,true));
54
+ if ($this->checkResponse("login_post",$res))
55
+ {
56
+ $this->updateDebugBuffer('login_post',"http://mail.rediff.com/cgi-bin/login.cgi",'POST',true,$post_elements);
57
+ $link_to_extract = $this->getElementString($res, 'window.location.replace(&quot;', '&quot;);');
58
+ $this->siteAddr = $this->getElementString($link_to_extract,'http://','/');
59
+ $this->username = $user;
60
+ $this->sess_id = $this->getElementString($link_to_extract,'&amp;session_id=','&amp;');
61
+ $url_redirect = "http://{$this->siteAddr}/bn/toggle.cgi?flipval=1&login={$this->username}&session_id={$this->sess_id}&folder=Inbox&formname=sh_folder&user_size=1";
62
+ }
63
+ else
64
+ {
65
+ $this->updateDebugBuffer('login_post',"http://mail.rediff.com/cgi-bin/login.cgi",'POST',false,$post_elements);
66
+ $this->debugRequest();
67
+ $this->stopPlugin();
68
+ return false;
69
+ }
70
+ $res = ($this->get($url_redirect, true));
71
+ if ($this->checkResponse("url_contacts",$res))
72
+ $this->updateDebugBuffer('url_contacts',"{$url_redirect}",'GET');
73
+ else
74
+ {
75
+ $this->updateDebugBuffer('url_contacts',"{$url_redirect}",'GET',false);
76
+ $this->debugRequest();
77
+ $this->stopPlugin();
78
+ return false;
79
+ }
80
+ $url_contact="http://{$this->siteAddr}/prism/exportaddrbook?output=web";
81
+ $this->login_ok = $url_contact;
82
+ $logout_url = "http://login.rediff.com/bn/logout.cgi?formname=general&login={$this->username}&session_id={$this->sess_id}&function_name=logout";
83
+ file_put_contents($this->getLogoutPath(),$logout_url);
84
+ return true;
85
+ }
86
+
87
+ /**
88
+ * Get the current user's contacts
89
+ *
90
+ * Makes all the necesarry requests to import
91
+ * the current user's contacts
92
+ *
93
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
94
+ */
95
+ public function getMyContacts()
96
+ {
97
+ if (!$this->login_ok)
98
+ {
99
+ $this->debugRequest();
100
+ $this->stopPlugin();
101
+ return false;
102
+ }
103
+ else $url=$this->login_ok;
104
+ $res=$this->get($url);
105
+ if ($this->checkResponse("url_contacts_form",$res))
106
+ $this->updateDebugBuffer('url_contacts_form',$url,'GET');
107
+ else
108
+ {
109
+ $this->updateDebugBuffer('url_contacts_form',$url,'GET',false);
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+
115
+ $post_elements=array('output'=>'web','els'=>$this->getElementString($res,'name="els" value="','"'),'exporttype'=>'outlook');
116
+ $form_action="http://{$this->siteAddr}/prism/exportaddrbook?service=outlook";
117
+ $res=$this->post($form_action,$post_elements);
118
+ if ($this->checkResponse("file_contacts",$res))
119
+ $this->updateDebugBuffer('file_contacts',"{$form_action}",'POST',true,$post_elements);
120
+ else
121
+ {
122
+ $this->updateDebugBuffer('file_contacts',"{$form_action}",'POST',false,$post_elements);
123
+ $this->debugRequest();
124
+ $this->stopPlugin();
125
+ return false;
126
+ }
127
+ $temp=$this->parseCSV($res);
128
+ $contacts=array();
129
+ foreach ($temp as $values)
130
+ {
131
+ $name=$values['0'].(empty($values['1'])?'':(empty($values['0'])?'':'-')."{$values['1']}").(empty($values['3'])?'':" \"{$values['3']}\"").(empty($values['2'])?'':' '.$values['2']);
132
+ if (!empty($values['5']))
133
+ $contacts[$values['5']]=array('first_name'=>$name,'email_1'=>$values['5']);
134
+ }
135
+
136
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
137
+ return $this->returnContacts($contacts);
138
+ }
139
+
140
+ /**
141
+ * Terminate session
142
+ *
143
+ * Terminates the current user's session,
144
+ * debugs the request and reset's the internal
145
+ * debudder.
146
+ *
147
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
148
+ */
149
+ public function logout()
150
+ {
151
+ if (!$this->checkSession()) return false;
152
+ if (file_exists($this->getLogoutPath()))
153
+ {
154
+ $url_logout=file_get_contents($this->getLogoutPath());
155
+ if (!empty($url_logout)) $res=$this->get($url_logout);
156
+ }
157
+ $this->debugRequest();
158
+ $this->resetDebugger();
159
+ $this->stopPlugin();
160
+ }
161
+ }
162
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/sapo.plg.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*This plugin import Sapo contacts
3
+ *You can send normal email
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Sapo.pt',
7
+ 'version'=>'1.0.4',
8
+ 'description'=>"Get the contacts from a Sapo.pt account",
9
+ 'base_version'=>'1.6.7',
10
+ 'type'=>'email',
11
+ 'check_url'=>'http://services.mail.sapo.pt/codebits/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>array('/(sapo.pt)/i'),
14
+ 'imported_details'=>array('first_name','email_1','nickname'),
15
+ );
16
+ /**
17
+ * Sapo Plugin
18
+ *
19
+ * Imports user's contacts from Sapo.pt's AddressBook
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class sapo extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'username',
33
+ 'get_contacts'=>'email',
34
+ );
35
+
36
+ /**
37
+ * Login function
38
+ *
39
+ * Makes all the necessary requests to authenticate
40
+ * the current user to the server.
41
+ *
42
+ * @param string $user The current user.
43
+ * @param string $pass The password for the current user.
44
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
45
+ */
46
+ public function login($user,$pass)
47
+ {
48
+ $this->resetDebugger();
49
+ $this->service='sapo';
50
+ $this->service_user=$user;
51
+ $this->service_password=$pass;
52
+ if (!$this->init()) return false;
53
+
54
+ $res=$this->get("http://services.mail.sapo.pt/codebits/");
55
+ if ($this->checkResponse("initial_get",$res))
56
+ $this->updateDebugBuffer('initial_get',"http://services.mail.sapo.pt/codebits/",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get',"http://services.mail.sapo.pt/codebits/",'GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+
65
+ $this->login_ok=array('user'=>$user,'pass'=>$pass);
66
+ return true;
67
+ }
68
+
69
+ /**
70
+ * Get the current user's contacts
71
+ *
72
+ * Makes all the necesarry requests to import
73
+ * the current user's contacts
74
+ *
75
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
76
+ */
77
+ public function getMyContacts()
78
+ {
79
+ if (!$this->login_ok)
80
+ {
81
+ $this->debugRequest();
82
+ $this->stopPlugin();
83
+ return false;
84
+ }
85
+ else $data=$this->login_ok;
86
+
87
+ $form_action="http://services.mail.sapo.pt/codebits/index.php";
88
+ $post_elements=array('username'=>$data['user'],'password'=>$data['pass'],'what'=>'contactos');
89
+
90
+ $res=$this->post($form_action,$post_elements);
91
+ if ($this->checkResponse("get_contacts",$res))
92
+ $this->updateDebugBuffer('get_contacts',$form_action,'POST',true,$post_elements);
93
+ else
94
+ {
95
+ $this->updateDebugBuffer('get_contacts',$form_action,'POST',false,$post_elements);
96
+ $this->debugRequest();
97
+ $this->stopPlugin();
98
+ return false;
99
+ }
100
+
101
+ $name_array=$this->getElementDOM($res,"//span[@class='n fn']");
102
+ $niks_array=$this->getElementDOM($res,"//span[@class='nickname']");
103
+ $email_array=$this->getElementDOM($res,"//span[@class='email']");
104
+ foreach($name_array as $key=>$value)
105
+ $contacts[$email_array[$key]]=array('first_name'=>$value,'nickname'=>(isset($niks_array[$key])?$niks_array[$key]:false),'email_1'=>$email_array[$key]);
106
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
107
+ return $this->returnContacts($contacts);
108
+ }
109
+
110
+ /**
111
+ * Terminate session
112
+ *
113
+ * Terminates the current user's session,
114
+ * debugs the request and reset's the internal
115
+ * debudder.
116
+ *
117
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
118
+ */
119
+ public function logout()
120
+ {
121
+ if (!$this->checkSession()) return false;
122
+ $this->debugRequest();
123
+ $this->resetDebugger();
124
+ $this->stopPlugin();
125
+ return true;
126
+ }
127
+
128
+ }
129
+
130
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/skyrock.plg.php ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Skyrock
3
+ * You can send private message using Skyrock system to your Friends
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Skyrock',
7
+ 'version'=>'1.0.7',
8
+ 'description'=>"Get the contacts from a Skyrock account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://www.skyrock.com/',
12
+ 'requirement'=>'user',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Skyrock Plugin
17
+ *
18
+ * Imports user's contacts from Skyrock and send messages
19
+ * using Skyrock's internal system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class skyrock extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'need_login_form_login',
33
+ 'login_post'=>'logout',
34
+ 'url_friends'=>'class="ecrire"',
35
+ 'url_send_message'=>'id_dest',
36
+ 'send_message'=>'confirmation'
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='skyrock';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("http://www.skyrock.com");
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"http://www.skyrock.com",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"http://www.skyrock.com",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+
68
+ $form_action="http://www.skyrock.com/";
69
+ $post_elements=array('need_login_form_login'=>$user,
70
+ 'need_login_form_password'=>$pass,
71
+ 'x'=>rand(0,20),
72
+ 'y'=>rand(0,20),
73
+ );
74
+ $res=$this->post($form_action,$post_elements,true);
75
+ if ($this->checkResponse("login_post",$res))
76
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
77
+ else
78
+ {
79
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
80
+ $this->debugRequest();
81
+ $this->stopPlugin();
82
+ return false;
83
+ }
84
+
85
+ $url_friends="http://www.skyrock.com/m/friends/";
86
+ $this->login_ok=$url_friends;
87
+ return true;
88
+ }
89
+
90
+ /**
91
+ * Get the current user's contacts
92
+ *
93
+ * Makes all the necesarry requests to import
94
+ * the current user's contacts
95
+ *
96
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
97
+ */
98
+ public function getMyContacts()
99
+ {
100
+ if (!$this->login_ok)
101
+ {
102
+ $this->debugRequest();
103
+ $this->stopPlugin();
104
+ return false;
105
+ }
106
+ else $url=$this->login_ok;
107
+ $res=$this->get($url);
108
+ if ($this->checkResponse("url_friends",$res))
109
+ $this->updateDebugBuffer('url_friends',$url,'GET');
110
+ else
111
+ {
112
+ $this->updateDebugBuffer('url_friends',$url,'GET',false);
113
+ $this->debugRequest();
114
+ $this->stopPlugin();
115
+ return false;
116
+ }
117
+
118
+ $contacts=array();
119
+ $page=0;$hasFriends=true;
120
+ while($hasFriends)
121
+ {
122
+ $page++;$message_array=array();
123
+ $names_array=$this->getElementDOM($res,"//ul[@class='friends_list']/li",'title');
124
+ $message_array=$this->getElementDOM($res,"//a[@class='ecrire']",'href');
125
+ if (empty($message_array)) $hasFriends=false;
126
+ if (!empty($names_array)) foreach($names_array as $key=>$value) $contacts[$message_array[$key]]=$value;
127
+ $url_next="http://www.skyrock.com/m/friends/?order=1&page={$page}";
128
+ $res=$this->get($url_next,true);
129
+ }
130
+
131
+ return $contacts;
132
+ }
133
+
134
+
135
+ /**
136
+ * Send message to contacts
137
+ *
138
+ * Sends a message to the contacts using
139
+ * the service's inernal messaging system
140
+ *
141
+ * @param string $session_id The OpenInviter user's session ID
142
+ * @param string $message The message being sent to your contacts
143
+ * @param array $contacts An array of the contacts that will receive the message
144
+ * @return mixed FALSE on failure.
145
+ */
146
+ public function sendMessage($session_id,$message,$contacts)
147
+ {
148
+ $countMessages=0;
149
+ foreach($contacts as $href=>$name)
150
+ {
151
+ $countMessages++;
152
+ $url_send_message=html_entity_decode("http://www.skyrock.com{$href}");
153
+ $res=$this->get($url_send_message);
154
+ if ($this->checkResponse("url_send_message",$res))
155
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET');
156
+ else
157
+ {
158
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET',false);
159
+ $this->debugRequest();
160
+ $this->stopPlugin();
161
+ return false;
162
+ }
163
+
164
+ $form_action="http://www.skyrock.com/m/messages/write_message.php";
165
+ $post_elements=array('id_dest'=>$this->getElementString($res,'name="id_dest" value="','"'),
166
+ 'sendMe'=>$this->getElementString($res,'sendMe" value="','"'),
167
+ 'posted'=>TRUE,
168
+ 'message_zone'=>$message['body'],
169
+ );
170
+ $res=$this->post($form_action,$post_elements,true);
171
+ if ($this->checkResponse("send_message",$res))
172
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
173
+ else
174
+ {
175
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
176
+ $this->debugRequest();
177
+ $this->stopPlugin();
178
+ return false;
179
+ }
180
+ sleep($this->messageDelay);
181
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
182
+ }
183
+ }
184
+
185
+ /**
186
+ * Terminate session
187
+ *
188
+ * Terminates the current user's session,
189
+ * debugs the request and reset's the internal
190
+ * debudder.
191
+ *
192
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
193
+ */
194
+ public function logout()
195
+ {
196
+ if (!$this->checkSession()) return false;
197
+ $res=$this->get("http://www.skyrock.com/m/account/logout.php");
198
+ $this->debugRequest();
199
+ $this->resetDebugger();
200
+ $this->stopPlugin();
201
+ return true;
202
+
203
+ }
204
+ }
205
+
206
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/tagged.plg.php ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Tagged',
4
+ 'version'=>'1.0.9',
5
+ 'description'=>"Get the contacts from a Tagged.com account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'social',
8
+ 'check_url'=>'http://www.tagged.com/home.html',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * Tagged Plugin
14
+ *
15
+ * Import user's contacts from a Tagged Account
16
+ *
17
+ * @author OpenInviter
18
+ * @version 1.0.0
19
+ */
20
+ class tagged extends openinviter_base
21
+ {
22
+ private $login_ok=false;
23
+ public $showContacts=true;
24
+ protected $timeout=30;
25
+
26
+ public $debug_array=array(
27
+ 'login_post'=>'http://www.tagged.com/home.html?jli=1',
28
+ 'redirect'=>'http://www.tagged.com/logout.html',
29
+ 'contacts'=>'name',
30
+ 'message'=>'recipientId'
31
+ );
32
+
33
+ /**
34
+ * Login function
35
+ *
36
+ * Makes all the necessary requests to authenticate
37
+ * the current user to the server.
38
+ *
39
+ * @param string $user The current user.
40
+ * @param string $pass The password for the current user.
41
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
42
+ */
43
+ public function login($user,$pass)
44
+ {
45
+ $this->resetDebugger();
46
+ $this->service='tagged';
47
+ $this->service_user=$user;
48
+ $this->service_password=$pass;
49
+ if (!$this->init()) return false;
50
+ $res = $this->get("http://www.tagged.com");
51
+ $postAction = "https://secure.tagged.com/secure_login.html?r=%2Fhome.html&uri=http%3A%2F%2Fwww.tagged.com";
52
+ $postElem = array();
53
+ $postElem['username'] = $user;
54
+ $postElem['password'] = $pass;
55
+ $res = $this->post($postAction, $postElem, true);
56
+ if ($this->checkResponse("login_post",$res))
57
+ $this->updateDebugBuffer('login_post',$postAction,'POST',true,$postElem);
58
+ else
59
+ {
60
+ $this->updateDebugBuffer('login_post',$postAction,'POST',false,$postElem);
61
+ $this->debugRequest();
62
+ $this->stopPlugin();
63
+ return false;
64
+ }
65
+ $res = $this->get("http://www.tagged.com/home.html?jli=1");
66
+ if ($this->checkResponse("redirect",$res))
67
+ $this->updateDebugBuffer('redirect',"http://www.tagged.com/home.html?jli=1",'GET');
68
+ else
69
+ {
70
+ $this->updateDebugBuffer('redirect',"http://www.tagged.com/home.html?jli=1",'GET',false);
71
+ $this->debugRequest();
72
+ $this->stopPlugin();
73
+ return false;
74
+ }
75
+
76
+ $url_get_friends='http://www.tagged.com/messages.html?action=compose';
77
+ $this->login_ok=$url_get_friends;
78
+ return true;
79
+ }
80
+
81
+ /**
82
+ * Get the current user's contacts
83
+ *
84
+ * Makes all the necesarry requests to import
85
+ * the current user's contacts
86
+ *
87
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
88
+ */
89
+ public function getMyContacts()
90
+ {
91
+ if (!$this->login_ok)
92
+ {
93
+ $this->debugRequest();
94
+ $this->stopPlugin();
95
+ return false;
96
+ }
97
+ else $url = $this->login_ok;
98
+ $res=$this->get($url);
99
+ if ($this->checkResponse("contacts",$res))
100
+ $this->updateDebugBuffer('contacts',$url,'GET');
101
+ else
102
+ {
103
+ $this->updateDebugBuffer('contacts',$url,'GET',false);
104
+ $this->debugRequest();
105
+ $this->stopPlugin();
106
+ return false;
107
+ }
108
+ $contacts = array();
109
+ if (preg_match_all("#\{\"name\"\:\"(.+)\"\,\"id\"\:(.+)\}#U", $res, $matches))
110
+ {
111
+ if (!empty($matches[1]))
112
+ foreach($matches[1] as $key=>$value)
113
+ if (!empty($matches[2][$key])) $contacts[$matches[2][$key]]=$value;
114
+ }
115
+
116
+ reset($contacts);$firstKey=key($contacts);
117
+ if (preg_match("#\[\{\"name\"\:\"(.+)\"\,\"id\"\:(.+)\}#U", $res, $matches)) $contacts[$firstKey]=$matches[1];
118
+ else unset($contacts[$firstKey]);
119
+
120
+ return $contacts;
121
+ }
122
+
123
+ /**
124
+ * Send message to contacts
125
+ *
126
+ * Sends a message to the contacts using
127
+ * the service's inernal messaging system
128
+ *
129
+ * @param string $cookie_file The location of the cookies file for the current session
130
+ * @param string $message The message being sent to your contacts
131
+ * @param array $contacts An array of the contacts that will receive the message
132
+ * @return mixed FALSE on failure.
133
+ */
134
+ public function sendMessage($session_id,$message,$contacts)
135
+ {
136
+ $countMessages=0;
137
+ foreach ($contacts as $id=>$username)
138
+ {
139
+ $countMessages++;
140
+ $form_action='http://www.tagged.com/handle_inbox.html';
141
+ $post_elements=array('recipient_id'=>$id,
142
+ 'subject'=>$message['subject'],
143
+ 'mce_editor_0_fontSizeSelect'=>0,
144
+ 'entryText'=>$message['body'],
145
+ 'from'=>'compose',
146
+ 'section'=>'send',
147
+ 'message_type'=>'N',
148
+ 'came_from_url'=>'http://www.tagged.com/messages.html',
149
+ 'save_sent'=>'save',
150
+ 'action'=>'sendMessage',
151
+ 'skip_confirmation'=>1,
152
+ 'ajax_sent'=>1,
153
+ 'recipient_id_hidden'=>0,
154
+ 'on_success_action'=>'call_function|complete_sendMsg()'
155
+ );
156
+ $res=$this->post($form_action,$post_elements,true);
157
+ if (strpos($res,'captcha')) break;
158
+ if ($this->checkResponse("message",$res))
159
+ $this->updateDebugBuffer('message',$form_action,'POST',true,$post_elements);
160
+ else
161
+ {
162
+ $this->updateDebugBuffer('message',$form_action,'POST',false,$post_elements);
163
+ $this->debugRequest();
164
+ $this->stopPlugin();
165
+ return false;
166
+ }
167
+ sleep($this->messageDelay);
168
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
169
+ }
170
+ }
171
+
172
+ /**
173
+ * Terminate session
174
+ *
175
+ * Terminates the current user's session,
176
+ * debugs the request and reset's the internal
177
+ * debudder.
178
+ *
179
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
180
+ */
181
+ public function logout()
182
+ {
183
+ if (!$this->checkSession()) return false;
184
+ $logout_url = "http://www.tagged.com/logout.html";
185
+ $res = $this->get($logout_url);
186
+ $this->debugRequest();
187
+ $this->resetDebugger();
188
+ $this->stopPlugin();
189
+ return true;
190
+ }
191
+ }
192
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/techemail.plg.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Techemail',
4
+ 'version'=>'1.0.3',
5
+ 'description'=>"Get the contacts from an Techemail account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://techemail.mail.everyone.net/email/scripts/loginuser.pl',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Techemail Plugin
15
+ *
16
+ * Imports user's contacts from Techemail's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class techemail extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ protected $timeout=30;
25
+ public $showContacts=true;
26
+ public $debug_array=array(
27
+ 'initial_get'=>'loginName',
28
+ 'login_post'=>'oi_sda_firstname',
29
+ 'get_contacts'=>'composeMe',
30
+ );
31
+
32
+ /**
33
+ * Login function
34
+ *
35
+ * Makes all the necessary requests to authenticate
36
+ * the current user to the server.
37
+ *
38
+ * @param string $user The current user.
39
+ * @param string $pass The password for the current user.
40
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
41
+ */
42
+ public function login($user,$pass)
43
+ {
44
+ $this->resetDebugger();
45
+ $this->service='techemail';
46
+ $this->service_user=$user;
47
+ $this->service_password=$pass;
48
+ if (!$this->init()) return false;
49
+ $res=$this->get("http://techemail.mail.everyone.net/email/scripts/loginuser.pl",true);
50
+ if ($this->checkResponse('initial_get',$res))
51
+ $this->updateDebugBuffer('initial_get',"http://super.popstarmail.org/",'GET');
52
+ else
53
+ {
54
+ $this->updateDebugBuffer('initial_get',"http://super.popstarmail.org/",'GET',false);
55
+ $this->debugRequest();
56
+ $this->stopPlugin();
57
+ return false;
58
+ }
59
+
60
+ $form_action="http://techemail.mail.everyone.net/email/scripts/loginuser.pl?EV1=".$this->getElementString($res,"loginuser.pl?EV1=",'"');
61
+ $post_elements=array('loginName'=>$user,'user_pwd'=>$pass,'login'=>'Login');
62
+ $res=$this->post($form_action,$post_elements,true);
63
+ if ($this->checkResponse("login_post",$res))
64
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
65
+ else
66
+ {
67
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
68
+ $this->debugRequest();
69
+ $this->stopPlugin();
70
+ return false;
71
+ }
72
+
73
+ $url_contacts="http://techemail.mail.everyone.net/email/scripts/contacts.pl?EV1=";
74
+ $this->login_ok=$url_contacts;
75
+ return true;
76
+ }
77
+
78
+ /**
79
+ * Get the current user's contacts
80
+ *
81
+ * Makes all the necesarry requests to import
82
+ * the current user's contacts
83
+ *
84
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
85
+ */
86
+ public function getMyContacts()
87
+ {
88
+ if (!$this->login_ok)
89
+ {
90
+ $this->debugRequest();
91
+ $this->stopPlugin();
92
+ return false;
93
+ }
94
+ else $url = $this->login_ok;
95
+ $res=$this->get($url,true);
96
+ if ($this->checkResponse('get_contacts',$res))
97
+ $this->updateDebugBuffer('get_contacts',$url,'GET');
98
+ else
99
+ {
100
+ $this->updateDebugBuffer('get_contacts',$url,'GET',false);
101
+ $this->debugRequest();
102
+ $this->stopPlugin();
103
+ return false;
104
+ }
105
+
106
+ $contacts=array();
107
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
108
+ $xpath=new DOMXPath($doc);$query="//a";$data=$xpath->query($query);
109
+ foreach($data as $node)
110
+ {
111
+ $nameBulk=$node->getAttribute('href');
112
+ if (strpos($nameBulk,'javascript:composeMe')!==false)
113
+ {
114
+ $name=$this->getElementString($nameBulk,'"','"');$email=$node->nodeValue;
115
+ if (!empty($email)) $contacts[$email]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$email);
116
+ }
117
+ }
118
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
119
+ return $this->returnContacts($contacts);
120
+ }
121
+
122
+
123
+ /**
124
+ * Terminate session
125
+ *
126
+ * Terminates the current user's session,
127
+ * debugs the request and reset's the internal
128
+ * debudder.
129
+ *
130
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
131
+ */
132
+ public function logout()
133
+ {
134
+ if (!$this->checkSession()) return false;
135
+ $logout_url="http://techemail.mail.everyone.net/email/scripts/logout.pl";
136
+ $res = $this->get($logout_url,true);
137
+ $this->debugRequest();
138
+ $this->resetDebugger();
139
+ $this->stopPlugin();
140
+ return true;
141
+ }
142
+ }
143
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/terra.plg.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Terra',
4
+ 'version'=>'1.0.8',
5
+ 'description'=>"Get the contacts from an Terra account",
6
+ 'base_version'=>'1.6.7',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://correo.terra.com/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Terra Plugin
15
+ *
16
+ * Imports user's contacts from Terra.com
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class terra extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array('initial_get'=>'username',
29
+ 'post_login'=>'location.href',
30
+ 'url_post_redirect'=>'td',
31
+ 'file_contacts'=>'Users["'
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user, $pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='terra';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("http://correo.terra.com/");
53
+ if ($this->checkResponse('initial_get',$res))
54
+ $this->updateDebugBuffer('initial_get',"http://correo.terra.com/",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"http://correo.terra.com/",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+
63
+ $form_action="http://correo.terra.com/atmail.php";
64
+ $post_elements=array('username'=>$user,'password'=>$pass);
65
+ $res=$this->post($form_action,$post_elements,true);
66
+ if ($this->checkResponse('post_login',$res))
67
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',true,$post_elements);
68
+ else
69
+ {
70
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',false,$post_elements);
71
+ $this->debugRequest();
72
+ $this->stopPlugin();
73
+ return false;
74
+ }
75
+ $url_redirect=$this->getElementString($res,"href='","'");
76
+ $domain=$this->getElementString($res,'http://correo.terra.com/','/showmail');
77
+ $res=$this->get($url_redirect,true);
78
+ if ($this->checkResponse('url_post_redirect',$res))
79
+ $this->updateDebugBuffer('url_post_redirect',"{$url_redirect}",'GET');
80
+ else
81
+ {
82
+ $this->updateDebugBuffer('url_post_redirect',"{$url_redirect}",'GET',false);
83
+ $this->debugRequest();
84
+ $this->stopPlugin();
85
+ return false;
86
+ }
87
+
88
+ $url_file_contacts="http://correo.terra.com/{$domain}/abook.php?func=composebook&emailto=&emailcc=&emailbcc=";
89
+ $this->login_ok=$url_file_contacts;
90
+ file_put_contents($this->getLogoutPath(),$domain);
91
+ return true;
92
+ }
93
+
94
+ /**
95
+ * Get the current user's contacts
96
+ *
97
+ * Makes all the necesarry requests to import
98
+ * the current user's contacts
99
+ *
100
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
101
+ */
102
+ public function getMyContacts()
103
+ {
104
+ if (!$this->login_ok)
105
+ {
106
+ $this->debugRequest();
107
+ $this->stopPlugin();
108
+ return false;
109
+ }
110
+ else $url=$this->login_ok;
111
+ $res=$this->get($url,true);
112
+ if ($this->checkResponse('file_contacts',$res))
113
+ $this->updateDebugBuffer('file_contacts',$url,'GET');
114
+ else
115
+ {
116
+ $this->updateDebugBuffer('file_contacts',$url,'GET',false);
117
+ $this->debugRequest();
118
+ $this->stopPlugin();
119
+ return false;
120
+ }
121
+ $contacts=array();
122
+ if (preg_match_all("#Users\[\"(.+)\"\] \= \'(.+) \&lt\;#U", $res, $matches))
123
+ if (!empty($matches[1]))
124
+ foreach($matches[1] as $key=>$email)
125
+ $contacts[$email]=array('first_name'=>(!empty($matches[2][$key])?$matches[2][$key]:false),'email_1'=>$email);
126
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
127
+ return $this->returnContacts($contacts);
128
+ }
129
+
130
+ /**
131
+ * Terminate session
132
+ *
133
+ * Terminates the current user's session,
134
+ * debugs the request and reset's the internal
135
+ * debudder.
136
+ *
137
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
138
+ */
139
+ public function logout()
140
+ {
141
+ if (!$this->checkSession()) return false;
142
+ if (file_exists($this->getLogoutPath()))
143
+ { $domain=file_get_contents($this->getLogoutPath());$res=$this->get("http://correo.terra.com{$domain}/index.php?func=logout",true); }
144
+ $this->debugRequest();
145
+ $this->resetDebugger();
146
+ $this->stopPlugin();
147
+ }
148
+ }
149
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/twitter.plg.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Twitter',
4
+ 'version'=>'1.0.8',
5
+ 'description'=>"Get the contacts from a Twitter account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'social',
8
+ 'check_url'=>'http://twitter.com',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * Twitter Plugin
14
+ *
15
+ * Imports user's contacts from Twitter and
16
+ * posts a new tweet from the user as a invite.
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.3
20
+ */
21
+ class twitter extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'responce_ok'=>'screen_name',
30
+ 'responce_ok_followers'=>'screen_name',
31
+ 'responce_ok_status'=>'status',
32
+ 'url_direct_message'=>'direct_message'
33
+ );
34
+
35
+ /**
36
+ * Login function
37
+ *
38
+ * Makes all the necessary requests to authenticate
39
+ * the current user to the server.
40
+ *
41
+ * @param string $user The current user.
42
+ * @param string $pass The password for the current user.
43
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
44
+ */
45
+ public function login($user,$pass)
46
+ {
47
+ $this->resetDebugger();
48
+ $this->service='twitter';
49
+ $this->service_user=$user;
50
+ $this->service_pass=$pass;
51
+ if (!$this->init()) return false;
52
+ $res=$this->get("http://{$user}:{$pass}@twitter.com/account/verify_credentials.xml",true);
53
+ if ($this->checkResponse('responce_ok',$res))
54
+ $this->updateDebugBuffer('responce_ok',"http://user:pass@twitter.com/account/verify_credentials.xml",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('responce_ok',"http://user:pass@twitter.com/account/verify_credentials.xml",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+ file_put_contents($this->getLogoutPath(),"{$user}/{$pass}");
63
+ return true;
64
+ }
65
+
66
+ /**
67
+ * Get the current user's contacts
68
+ *
69
+ * Makes all the necesarry requests to import
70
+ * the current user's contacts
71
+ *
72
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
73
+ */
74
+ public function getMyContacts()
75
+ {
76
+ if (file_exists($this->getLogoutPath()))
77
+ {$auth=explode("/",file_get_contents($this->getLogoutPath()));$user=$auth[0];$pass=$auth[1];}
78
+ else return false;
79
+ $res=$this->get("http://{$user}:{$pass}@twitter.com/statuses/followers.xml",true);
80
+ if ($this->checkResponse('responce_ok_followers',$res))
81
+ $this->updateDebugBuffer('responce_ok_followers',"http://user:pass@twitter.com/statuses/followers.xml",'GET');
82
+ else
83
+ {
84
+ $this->updateDebugBuffer('responce_ok_followers',"http://user:pass@twitter.com/statuses/followers.xml",'GET',false);
85
+ $this->debugRequest();
86
+ $this->stopPlugin();
87
+ return false;
88
+ }
89
+ $contacts=$this->getElementDOM($res,'//screen_name');
90
+ return $contacts;
91
+ }
92
+
93
+ /**
94
+ * Send message to contacts
95
+ *
96
+ * Sends a message to the contacts using
97
+ * the service's inernal messaging system
98
+ *
99
+ * @param string $cookie_file The location of the cookies file for the current session
100
+ * @param string $message The message being sent to your contacts
101
+ * @param array $contacts An array of the contacts that will receive the message
102
+ * @return mixed FALSE on failure.
103
+ */
104
+ public function sendMessage($session_id,$message,$contacts)
105
+ {
106
+ if (file_exists($this->getLogoutPath()))
107
+ {$auth=explode("/",file_get_contents($this->getLogoutPath()));$user=$auth[0];$pass=$auth[1];}
108
+ else return false;
109
+ $post_elements=array('status'=>$message['body']);
110
+ $res=$this->post("http://{$user}:{$pass}@twitter.com/statuses/update.xml",$post_elements,true);
111
+ if ($this->checkResponse('responce_ok_status',$res))
112
+ $this->updateDebugBuffer('responce_ok_status',"http://user:pass@twitter.com/statuses/update.xml",'POST',true,$post_elements);
113
+ else
114
+ {
115
+ $this->updateDebugBuffer('responce_ok_status',"http://user:pass@twitter.com/statuses/update.xml",'POST',false,$post_elements);
116
+ $this->debugRequest();
117
+ $this->stopPlugin();
118
+ return false;
119
+ }
120
+ $countMessages=0;
121
+ foreach($contacts as $key=>$screen_name)
122
+ {
123
+ $countMessages++;
124
+ $post_elements=array('user'=>$screen_name,'text'=>$message['body']);
125
+ $res=$this->post("http://{$user}:{$pass}@twitter.com/direct_messages/new.xml",$post_elements);
126
+ if ($this->checkResponse('url_direct_message',$res))
127
+ $this->updateDebugBuffer('url_direct_message',"http://user:pass@twitter.com/direct_messages/new.xml",'POST',true,$post_elements);
128
+ else
129
+ {
130
+ $this->updateDebugBuffer('url_direct_message',"http://user:pass@twitter.com/direct_messages/new.xml",'POST',false,$post_elements);
131
+ $this->debugRequest();
132
+ $this->stopPlugin();
133
+ return false;
134
+ }
135
+ sleep($this->messageDelay);
136
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
137
+ }
138
+ }
139
+
140
+ /**
141
+ * Terminate session
142
+ *
143
+ * Terminates the current user's session,
144
+ * debugs the request and reset's the internal
145
+ * debudder.
146
+ *
147
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
148
+ *
149
+ */
150
+ public function logout()
151
+ {
152
+ if (!$this->checkSession()) return false;
153
+ $this->debugRequest();
154
+ $this->resetDebugger();
155
+ $this->stopPlugin();
156
+ return true;
157
+ }
158
+ }
159
+
160
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/uk2.plg.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Uk2',
4
+ 'version'=>'1.0.3',
5
+ 'description'=>"Get the contacts from a Uk2 account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://mail.uk2.net/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','middle_name','last_name','nickname','email_1','email_2','email_3','organization','phone_mobile','phone_home','phone_work','fax','pager','address_home','address_work','website','address_city','address_state','address_country','postcode_home','isq_messenger','skype_messenger','yahoo_messenger','msn_messenger','aol_messenger','other_messenger'),
12
+ );
13
+ /**
14
+ * Uk2 Plugin
15
+ *
16
+ * Imports user's contacts from Uk2 AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class uk2 extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'username',
30
+ 'login_post'=>'parse',
31
+ 'url_inbox'=>'parse',
32
+ 'contacts_file'=>'Email'
33
+
34
+ );
35
+
36
+ /**
37
+ * Login function
38
+ *
39
+ * Makes all the necessary requests to authenticate
40
+ * the current user to the server.
41
+ *
42
+ * @param string $user The current user.
43
+ * @param string $pass The password for the current user.
44
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
45
+ */
46
+ public function login($user,$pass)
47
+ {
48
+ $this->resetDebugger();
49
+ $this->service='uk2';
50
+ $this->service_user=$user;
51
+ $this->service_password=$pass;
52
+ if (!$this->init()) return false;
53
+
54
+ $res=$this->get("http://mail.uk2.net/",true);
55
+ if ($this->checkResponse("initial_get",$res))
56
+ $this->updateDebugBuffer('initial_get',"http://mail.uk2.net/",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get','http://mail.uk2.net/','GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+
65
+ $form_action='http://mail.uk2.net/atmail.pl';
66
+ $post_elements=array('Language'=>'english','username'=>$user,'pop3host'=>'uk2.net','password'=>$pass,'LoginType'=>'xul');
67
+ $res=$this->post($form_action,$post_elements,false,true,false,array(),false,false);
68
+ if ($this->checkResponse('login_post',$res))
69
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
70
+ else
71
+ {
72
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
73
+ $this->debugRequest();
74
+ $this->stopPlugin();
75
+ return false;
76
+ }
77
+
78
+ $url_redirect='http://mail.uk2.net/'.$this->getElementString($res,"href='","'");
79
+ $res=$this->get($url_redirect,true);
80
+ if ($this->checkResponse("url_inbox",$res))
81
+ $this->updateDebugBuffer('url_inbox',$url_redirect,'GET');
82
+ else
83
+ {
84
+ $this->updateDebugBuffer('url_inbox',$url_redirect,'GET',false);
85
+ $this->debugRequest();
86
+ $this->stopPlugin();
87
+ return false;
88
+ }
89
+
90
+ $url_export='http://mail.uk2.net/abook.pl?func=export&abookview=personal';
91
+ $this->login_ok=$url_export;
92
+ return true;
93
+ }
94
+
95
+ /**
96
+ * Get the current user's contacts
97
+ *
98
+ * Makes all the necesarry requests to import
99
+ * the current user's contacts
100
+ *
101
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
102
+ */
103
+ public function getMyContacts()
104
+ {
105
+ if (!$this->login_ok)
106
+ {
107
+ $this->debugRequest();
108
+ $this->stopPlugin();
109
+ return false;
110
+ }
111
+ else $url=$this->login_ok;
112
+ $res=$this->get($url);
113
+ if ($this->checkResponse("contacts_file",$res))
114
+ $this->updateDebugBuffer('contacts_file',$url,'GET');
115
+ else
116
+ {
117
+ $this->updateDebugBuffer('contacts_file',$url,'GET',false);
118
+ $this->debugRequest();
119
+ $this->stopPlugin();
120
+ return false;
121
+ }
122
+
123
+ $temp=$this->parseCSV($res);
124
+ $contacts=array();
125
+ foreach ($temp as $values)
126
+ {
127
+ if (!empty($values[3]))
128
+ $contacts[$values[3]]=array('first_name'=>(!empty($values[20])?$values[20]:false),
129
+ 'middle_name'=>(!empty($values[8])?$values[8]:false),
130
+ 'last_name'=>false,
131
+ 'nickname'=>false,
132
+ 'email_1'=>(!empty($values[3])?$values[3]:false),
133
+ 'email_2'=>false,
134
+ 'email_3'=>false,
135
+ 'organization'=>false,
136
+ 'phone_mobile'=>(!empty($values[11])?$values[11]:false),
137
+ 'phone_home'=>(!empty($values[9])?$values[9]:false),
138
+ 'pager'=>false,
139
+ 'address_home'=>false,
140
+ 'address_city'=>(!empty($values[5])?$values[5]:false),
141
+ 'address_state'=>(!empty($values[7])?$values[7]:false),
142
+ 'address_country'=>(!empty($values[8])?$values[8]:false),
143
+ 'postcode_home'=>(!empty($values[6])?$values[6]:false),
144
+ 'company_work'=>(!empty($values[14])?$values[14]:false),
145
+ 'address_work'=>false,
146
+ 'address_work_city'=>(!empty($values[16])?$values[16]:false),
147
+ 'address_work_country'=>(!empty($values[19])?$values[19]:false),
148
+ 'address_work_state'=>(!empty($values[17])?$values[17]:false),
149
+ 'address_work_postcode'=>(!empty($values[18])?$values[18]:false),
150
+ 'fax_work'=>(!empty($values[21])?$values[21]:false),
151
+ 'phone_work'=>(!empty($values[20])?$values[20]:false),
152
+ 'website'=>(!empty($values[12])?$values[12]:false),
153
+ 'isq_messenger'=>false,
154
+ 'skype_essenger'=>false,
155
+ 'yahoo_essenger'=>false,
156
+ 'msn_messenger'=>false,
157
+ 'aol_messenger'=>false,
158
+ 'other_messenger'=>false,
159
+ );
160
+ }
161
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
162
+ return $this->returnContacts($contacts);
163
+ }
164
+
165
+ /**
166
+ * Terminate session
167
+ *
168
+ * Terminates the current user's session,
169
+ * debugs the request and reset's the internal
170
+ * debudder.
171
+ *
172
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
173
+ */
174
+ public function logout()
175
+ {
176
+ if (!$this->checkSession()) return false;
177
+ $res=$this->get('http://mail.uk2.net/util.pl?func=logout',true);
178
+ $this->debugRequest();
179
+ $this->resetDebugger();
180
+ $this->stopPlugin();
181
+ return true;
182
+ }
183
+
184
+ }
185
+
186
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/vimeo.plg.php ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Vimeo
3
+ * You can Post Messages using Vimeo system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Vimeo',
7
+ 'version'=>'1.0.3',
8
+ 'description'=>"Get the contacts from a Vimeo account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://vimeo.com/',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Vimeo Plugin
17
+ *
18
+ * Import user's contacts from Vimeo and Post comments
19
+ * using Vimeo's internal Posting system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class vimeo extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'sign_in[email]',
33
+ 'login_post'=>'user',
34
+ 'url_home'=>'contacts',
35
+ 'get_friends'=>'username',
36
+ 'url_send_message'=>'MemoContent',
37
+ 'send_message'=>'was sent'
38
+ );
39
+
40
+ /**
41
+ * Login function
42
+ *
43
+ * Makes all the necessary requests to authenticate
44
+ * the current user to the server.
45
+ *
46
+ * @param string $user The current user.
47
+ * @param string $pass The password for the current user.
48
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
49
+ */
50
+ public function login($user,$pass)
51
+ {
52
+ $this->resetDebugger();
53
+ $this->service='vimeo';
54
+ $this->service_user=$user;
55
+ $this->service_password=$pass;
56
+ if (!$this->init()) return false;
57
+
58
+ $res=$this->get("http://vimeo.com/log_in");
59
+ if ($this->checkResponse("initial_get",$res))
60
+ $this->updateDebugBuffer('initial_get',"http://vimeo.com/log_in",'GET');
61
+ else
62
+ {
63
+ $this->updateDebugBuffer('initial_get',"http://vimeo.com/log_in",'GET',false);
64
+ $this->debugRequest();
65
+ $this->stopPlugin();
66
+ return false;
67
+ }
68
+
69
+ $form_action="http://vimeo.com/log_in";
70
+ $post_elements=array('sign_in[email]'=>$user,'sign_in[password]'=>$pass);
71
+ $res=$this->post($form_action,$post_elements,true);
72
+ if ($this->checkResponse("login_post",$res))
73
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
74
+ else
75
+ {
76
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
77
+ $this->debugRequest();
78
+ $this->stopPlugin();
79
+ return false;
80
+ }
81
+
82
+ $url_profile='http://vimeo.com/';
83
+ $this->login_ok=$url_profile;
84
+ return true;
85
+ }
86
+
87
+ /**
88
+ * Get the current user's contacts
89
+ *
90
+ * Makes all the necesarry requests to import
91
+ * the current user's contacts
92
+ *
93
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
94
+ */
95
+ public function getMyContacts()
96
+ {
97
+ if (!$this->login_ok)
98
+ {
99
+ $this->debugRequest();
100
+ $this->stopPlugin();
101
+ return false;
102
+ }
103
+ else $url=$this->login_ok;
104
+ $res=$this->get($url);
105
+ if ($this->checkResponse("url_home",$res))
106
+ $this->updateDebugBuffer('url_home',$url,'GET');
107
+ else
108
+ {
109
+ $this->updateDebugBuffer('url_home',$url,'GET',false);
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+
115
+ $user_id=$this->getElementString($res,'http://vimeo.com/user','/');
116
+ $url_contacts="http://vimeo.com/user{$user_id}/contacts";
117
+ $res=$this->get($url_contacts);
118
+ if ($this->checkResponse("get_friends",$res))
119
+ $this->updateDebugBuffer('get_friends',$url_contacts,'GET');
120
+ else
121
+ {
122
+ $this->updateDebugBuffer('get_friends',$url_contacts,'GET',false);
123
+ $this->debugRequest();
124
+ $this->stopPlugin();
125
+ return false;
126
+ }
127
+
128
+ $contacts=array();
129
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
130
+ $xpath=new DOMXPath($doc);$query="//a[@class='username']";$data=$xpath->query($query);
131
+ foreach($data as $node)
132
+ {
133
+ $name=$node->nodeValue;
134
+ $id=str_replace('/user','',(string)$node->getAttribute('href'));
135
+ if (!empty($name)) $contacts[$id]=$name;
136
+ }
137
+ return $contacts;
138
+ }
139
+
140
+ /**
141
+ * Send message to contacts
142
+ *
143
+ * Sends a message to the contacts using
144
+ * the service's inernal messaging system
145
+ *
146
+ * @param string $cookie_file The location of the cookies file for the current session
147
+ * @param string $message The message being sent to your contacts
148
+ * @param array $contacts An array of the contacts that will receive the message
149
+ * @return mixed FALSE on failure.
150
+ */
151
+ public function sendMessage($session_id,$message,$contacts)
152
+ {
153
+ $countMessages=0;
154
+ foreach($contacts as $id=>$name)
155
+ {
156
+ $countMessages++;
157
+ $form_action="http://vimeo.com/ajax/conversation/send_message";
158
+ $post_elements=array('message'=>$message['body'],'jdata'=>'{"user_id":'.$id.',"layout":"private"}');
159
+ $res=$this->post($form_action,$post_elements);
160
+ if ($this->checkResponse("send_message",$res))
161
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
162
+ else
163
+ {
164
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
165
+ $this->debugRequest();
166
+ $this->stopPlugin();
167
+ return false;
168
+ }
169
+ sleep($this->messageDelay);
170
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
171
+ }
172
+
173
+ }
174
+
175
+ /**
176
+ * Terminate session
177
+ *
178
+ * Terminates the current user's session,
179
+ * debugs the request and reset's the internal
180
+ * debudder.
181
+ *
182
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
183
+ */
184
+ public function logout()
185
+ {
186
+ if (!$this->checkSession()) return false;
187
+ $res=$this->get("http://vimeo.com/log_out");
188
+ $this->debugRequest();
189
+ $this->resetDebugger();
190
+ $this->stopPlugin();
191
+ return true;
192
+ }
193
+ }
194
+
195
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/virgilio.plg.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Virgilio',
4
+ 'version'=>'1.0.3',
5
+ 'description'=>"Get the contacts from an virgilio.it account",
6
+ 'base_version'=>'1.0.0',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://mobimail.virgilio.it/cp/ps/Main/login/LoginVirgilio?d=virgilio.it',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Virgilio.it Plugin
15
+ *
16
+ * Imports user's contacts from Virgilio.it account
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class virgilio extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+ private $sessionVer;
28
+ public $debug_array=array('initial_get'=>'login_type',
29
+ 'login_post'=>'&t=',
30
+ 'url_contact'=>'contatti'
31
+ );
32
+
33
+ /**
34
+ * Login function
35
+ *
36
+ * Makes all the necessary requests to authenticate
37
+ * the current user to the server.
38
+ *
39
+ * @param string $user The current user.
40
+ * @param string $pass The password for the current user.
41
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
42
+ */
43
+ public function login($user, $pass)
44
+ {
45
+ $this->resetDebugger();
46
+ $this->service='virgilio';
47
+ $this->service_user=$user;
48
+ $this->service_password=$pass;
49
+ if (!$this->init()) return false;
50
+ $res = $this->get("http://mobimail.virgilio.it/cp/ps/Main/login/LoginVirgilio?d=virgilio.it",true);
51
+ if ($this->checkResponse("initial_get",$res))
52
+ $this->updateDebugBuffer('initial_get',"http://mobimail.virgilio.it/cp/ps/Main/login/LoginVirgilio?d=virgilio.it",'GET');
53
+ else
54
+ {
55
+ $this->updateDebugBuffer('initial_get',"http://mobimail.virgilio.it/cp/ps/Main/login/LoginVirgilio?d=virgilio.it",'GET',false);
56
+ $this->debugRequest();
57
+ $this->stopPlugin();
58
+ return false;
59
+ }
60
+ $form_action="http://mobimail.virgilio.it/cp/ps/Main/login/WrapLogin";
61
+ $post_elements=array('p'=>false,'login_type'=>'virgilio','NGUserID'=>'null','u'=>$user,'password'=>$pass,'d'=>'virgilio.it');
62
+ $res=$this->post($form_action,$post_elements,true);
63
+ if ($this->checkResponse('login_post',$res))
64
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
65
+ else
66
+ {
67
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
68
+ $this->debugRequest();
69
+ $this->stopPlugin();
70
+ return false;
71
+ }
72
+ $vergilioT=$this->getElementString($res,'&t=','&');$this->sessionVer=$vergilioT;
73
+ $url_contacts="http://mobimail.virgilio.it/cp/ps/PSPab/Contacts?d=virgilio.it&u={$user}&t={$vergilioT}&reset=true&startAt=1&l=it";
74
+ $this->login_ok=$url_contacts;
75
+ file_put_contents($this->getLogoutPath(),$vergilioT);
76
+ return true;
77
+ }
78
+
79
+ /**
80
+ * Get the current user's contacts
81
+ *
82
+ * Makes all the necesarry requests to import
83
+ * the current user's contacts
84
+ *
85
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
86
+ */
87
+ public function getMyContacts()
88
+ {
89
+ if (!$this->login_ok)
90
+ {
91
+ $this->debugRequest();
92
+ $this->stopPlugin();
93
+ return false;
94
+ }
95
+ else $url=$this->login_ok;
96
+ $res=$this->get($url,true);
97
+ if ($this->checkResponse("url_contact",$res))
98
+ $this->updateDebugBuffer('url_contact',$this->login_ok,'GET');
99
+ else
100
+ {
101
+ $this->updateDebugBuffer('url_contact',$this->login_ok,'GET',false);
102
+ $this->debugRequest();
103
+ $this->stopPlugin();
104
+ return false;
105
+ }
106
+ $contacts=array();
107
+ $nrFriends=(int)$this->getElementString($res,"Hai "," contatti");$exit=0;$page=1;
108
+ while($nrFriends>count($contacts))
109
+ {
110
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
111
+ $xpath=new DOMXPath($doc);$query="//a";$data=$xpath->query($query);
112
+ foreach($data as $node)
113
+ if (strpos($node->getAttribute('href'),'PABreturnURL=Contacts')!==false)
114
+ { $name=$node->childNodes->item(0)->nodeValue;$email=$node->childNodes->item(2)->nodeValue;if (!empty($email)) $contacts[$email]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$email); }
115
+ $page++;$res=$this->get("http://mobimail.virgilio.it/cp/ps/PSPab/Contacts?d=virgilio.it&u={$this->service_user}&t={$this->sessionVer}&reset=true&startAt={$page}&l=it",true);
116
+ }
117
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
118
+ return $this->returnContacts($contacts);
119
+ }
120
+
121
+ /**
122
+ * Terminate session
123
+ *
124
+ * Terminates the current user's session,
125
+ * debugs the request and reset's the internal
126
+ * debudder.
127
+ *
128
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
129
+ */
130
+ public function logout()
131
+ {
132
+ if (!$this->checkSession()) return false;
133
+ if (file_exists($this->getLogoutPath()))
134
+ {$vergilioT=file_get_contents($this->getLogoutPath());$res=$this->get("http://mobimail.virgilio.it/cp/ps/Main/login/Logout?d=virgilio.it&u={$this->service_user}&t={$vergilioT}&l=it",true);}
135
+ $this->debugRequest();
136
+ $this->resetDebugger();
137
+ $this->stopPlugin();
138
+ return true;
139
+ }
140
+ }
141
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/vkontakte.plg.php ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from vkontakte.ru
3
+ * You can Post Messages using Vkontakte system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Vkontakte',
7
+ 'version'=>'1.0.3',
8
+ 'description'=>"Get the contacts from a Vkontakte.ru account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://vkontakte.ru',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Cyworld Plugin
17
+ *
18
+ * Import user's contacts from vkontakte.ru and Sends private messages
19
+ * using vkontakte.ru internal Posting system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.0
23
+ */
24
+ class vkontakte extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'email',
33
+ 'login_post'=>'myfriends',
34
+ 'get_friends'=>'friendOrder',
35
+ 'url_send_message'=>'title',
36
+ 'send_message'=>'<div id="message">'
37
+ );
38
+
39
+ /**
40
+ * Login function
41
+ *
42
+ * Makes all the necessary requests to authenticate
43
+ * the current user to the server.
44
+ *
45
+ * @param string $user The current user.
46
+ * @param string $pass The password for the current user.
47
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
48
+ */
49
+ public function login($user,$pass)
50
+ {
51
+ $this->resetDebugger();
52
+ $this->service='vkontakte';
53
+ $this->service_user=$user;
54
+ $this->service_password=$pass;
55
+ if (!$this->init()) return false;
56
+
57
+ $res=$this->get("http://vkontakte.ru/");
58
+ if ($this->checkResponse("initial_get",$res))
59
+ $this->updateDebugBuffer('initial_get',"http://vkontakte.ru/",'GET');
60
+ else
61
+ {
62
+ $this->updateDebugBuffer('initial_get',"http://vkontakte.ru/",'GET',false);
63
+ $this->debugRequest();
64
+ $this->stopPlugin();
65
+ return false;
66
+ }
67
+
68
+ $form_action="http://vkontakte.ru/login.php";
69
+ $post_elements=array("try_to_login"=>1,"email"=>$user,"pass"=>$pass);
70
+ $res=$this->post($form_action,$post_elements,true);
71
+
72
+ if ($this->checkResponse("login_post",$res))
73
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
74
+ else
75
+ {
76
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
77
+ $this->debugRequest();
78
+ $this->stopPlugin();
79
+ return false;
80
+ }
81
+
82
+ $url_friends="http://vkontakte.ru/".$this->getElementString($res,"myfriends'><a href='","'");
83
+ $this->login_ok=$url_friends;
84
+ return true;
85
+ }
86
+
87
+ /**
88
+ * Get the current user's contacts
89
+ *
90
+ * Makes all the necesarry requests to import
91
+ * the current user's contacts
92
+ *
93
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
94
+ */
95
+ public function getMyContacts()
96
+ {
97
+ if (!$this->login_ok)
98
+ {
99
+ $this->debugRequest();
100
+ $this->stopPlugin();
101
+ return false;
102
+ }
103
+ else $url=$this->login_ok;
104
+ $res=$this->get($url);
105
+ if ($this->checkResponse("get_friends",$res))
106
+ $this->updateDebugBuffer('get_friends',$url,'GET');
107
+ else
108
+ {
109
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+
115
+ $contacts=array();
116
+ while (strpos($res,'list:[[')!==false)
117
+ {
118
+ $countact_bulk=$this->getElementString($res,'list:[[','}');
119
+ $id=substr($countact_bulk,0,strpos($countact_bulk,','));
120
+ $names_array=explode("'",$countact_bulk);
121
+ if (isset($id))
122
+ $contacts[$id]=(isset($names_array[1])?$names_array[1]:false)." ".(isset($names_array[3])?$names_array[3]:false);
123
+ $res=str_replace("list:[[".$countact_bulk,"",$res);
124
+ }
125
+ return $contacts;
126
+ }
127
+
128
+ /**
129
+ * Send message to contacts
130
+ *
131
+ * Sends a message to the contacts using
132
+ * the service's inernal messaging system
133
+ *
134
+ * @param string $cookie_file The location of the cookies file for the current session
135
+ * @param string $message The message being sent to your contacts
136
+ * @param array $contacts An array of the contacts that will receive the message
137
+ * @return mixed FALSE on failure.
138
+ */
139
+ public function sendMessage($session_id,$message,$contacts)
140
+ {
141
+ $countMessages=0;
142
+ foreach($contacts as $id=>$name)
143
+ {
144
+ $countMessages++;
145
+ $url_send_message="http://vkontakte.ru/mail.php?act=write&to={$id}";
146
+ $res=$this->get($url_send_message);
147
+ if ($this->checkResponse("url_send_message",$res))
148
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET');
149
+ else
150
+ {
151
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET',false);
152
+ $this->debugRequest();
153
+ $this->stopPlugin();
154
+ return false;
155
+ }
156
+
157
+ $form_action="http://vkontakte.ru/mail.php";
158
+ $post_elements=$this->getHiddenElements($res);$post_elements['title']=$message['subject'];$post_elements['message']=$message['body'];
159
+ $res=$this->post($form_action,$post_elements);
160
+ if ($this->checkResponse("send_message",$res))
161
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
162
+ else
163
+ {
164
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
165
+ $this->debugRequest();
166
+ $this->stopPlugin();
167
+ return false;
168
+ }
169
+ sleep($this->messageDelay);
170
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
171
+ }
172
+
173
+ }
174
+
175
+ /**
176
+ * Terminate session
177
+ *
178
+ * Terminates the current user's session,
179
+ * debugs the request and reset's the internal
180
+ * debudder.
181
+ *
182
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
183
+ */
184
+ public function logout()
185
+ {
186
+ if (!$this->checkSession()) return false;
187
+ $res=$this->get("http://vkontakte.ru/login.php?op=logout");
188
+ $this->debugRequest();
189
+ $this->resetDebugger();
190
+ $this->stopPlugin();
191
+ return true;
192
+ }
193
+ }
194
+
195
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/walla.plg.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Walla',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from a Walla mail account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://friends.walla.co.il/?tsscript=login&theme=&ReturnURL=http://mail.walla.co.il/index.cgi',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Walla Plugin
15
+ *
16
+ * Imports user's contacts from Walla's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class walla extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'@login',
30
+ 'post_login'=>'newaddress',
31
+ 'url_contacts'=>'@compose',
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user,$pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='walla';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res=$this->get("http://friends.walla.co.il/?tsscript=login&theme=&ReturnURL=http://mail.walla.co.il/index.cgi",true);
53
+ if ($this->checkResponse('initial_get',$res))
54
+ $this->updateDebugBuffer('initial_get',"http://www.gawab.com/default.php",'GET');
55
+ else
56
+ {
57
+ $this->updateDebugBuffer('initial_get',"http://www.gawab.com/default.php",'GET',false);
58
+ $this->debugRequest();
59
+ $this->stopPlugin();
60
+ return false;
61
+ }
62
+
63
+ $form_action="http://friends.walla.co.il/";
64
+ $post_elements=array('w'=>'/@login.commit',
65
+ 'ReturnURL'=>'http://mail.walla.co.il/index.cgi',
66
+ 'username'=>$user,
67
+ 'password'=>$pass
68
+ );
69
+ $res=$this->post($form_action,$post_elements,true);
70
+ if ($this->checkResponse('post_login',$res))
71
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',true,$post_elements);
72
+ else
73
+ {
74
+ $this->updateDebugBuffer('post_login',"{$form_action}",'POST',false,$post_elements);
75
+ $this->debugRequest();
76
+ $this->stopPlugin();
77
+ return false;
78
+ }
79
+ $url_contacts="http://newaddress.walla.co.il";
80
+ $this->login_ok=$url_contacts;
81
+ return true;
82
+ }
83
+
84
+ /**
85
+ * Get the current user's contacts
86
+ *
87
+ * Makes all the necesarry requests to import
88
+ * the current user's contacts
89
+ *
90
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
91
+ */
92
+ public function getMyContacts()
93
+ {
94
+ if (!$this->login_ok)
95
+ {
96
+ $this->debugRequest();
97
+ $this->stopPlugin();
98
+ return false;
99
+ }
100
+ else $url=$this->login_ok;
101
+ $res=$this->get($url);
102
+ if ($this->checkResponse('url_contacts',$res))
103
+ $this->updateDebugBuffer('url_contacts',$url,'GET');
104
+ else
105
+ {
106
+ $this->updateDebugBuffer('url_contacts',$url,'GET',false);
107
+ $this->debugRequest();
108
+ $this->stopPlugin();
109
+ return false;
110
+ }
111
+
112
+ $contacts=array();
113
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
114
+ $xpath=new DOMXPath($doc);$query="//a";$data=$xpath->query($query);
115
+ foreach($data as $node)
116
+ {
117
+ if (strpos($node->getAttribute('href'),'@view')!==false) $name=$node->nodeValue;
118
+ if (strpos($node->getAttribute('href'),'w=/@compose')!==false) $email=$node->nodeValue;
119
+ if (!empty($email))
120
+ $contacts[$email]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$email);
121
+ }
122
+
123
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
124
+ return $this->returnContacts($contacts);
125
+
126
+ }
127
+
128
+ /**
129
+ * Terminate session
130
+ *
131
+ * Terminates the current user's session,
132
+ * debugs the request and reset's the internal
133
+ * debudder.
134
+ *
135
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
136
+ */
137
+ public function logout()
138
+ {
139
+ if (!$this->checkSession()) return false;
140
+ $res=$this->get("http://friends.walla.co.il/?w=/@logout",true);
141
+ $this->debugRequest();
142
+ $this->resetDebugger();
143
+ $this->stopPlugin();
144
+ return true;
145
+ }
146
+
147
+ }
148
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/web_de.plg.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Web.de',
4
+ 'version'=>'1.0.6',
5
+ 'description'=>"Get the contacts from an web.de account",
6
+ 'base_version'=>'1.6.7',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://m.web.de',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * web.de Plugin
15
+ *
16
+ * Imports user's contacts from web.de's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.6.7
20
+ */
21
+ class web_de extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ protected $timeout=30;
26
+ public $debug_array=array(
27
+ 'initial_check'=>'[5]',
28
+ );
29
+
30
+ /**
31
+ * Login function
32
+ *
33
+ * Makes all the necessary requests to authenticate
34
+ * the current user to the server.
35
+ *
36
+ * @param string $user The current user.
37
+ * @param string $pass The password for the current user.
38
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
39
+ */
40
+ public function login($user,$pass)
41
+ {
42
+ $this->resetDebugger();
43
+ $this->service='web_de';
44
+ $this->service_user=$user;
45
+ $this->service_password=$pass;
46
+ if (!$this->init()) return false;
47
+
48
+ $res=$this->get("http://m.web.de");
49
+ $postElem = $this->getHiddenElements($res);
50
+ $postAction = $this->getElementString($res,'action="','"');
51
+ $s=str_replace(";",'',$this->getElementString($res,'/;s=','/'));
52
+
53
+ $postAction='/;e=utf-8;s='.$s.'/mail';
54
+
55
+ $postElem['user']=$user;
56
+ $postElem['passw']=$pass;
57
+ $postElem['sv-remove-name']='Login';
58
+ $res = $this->post("http://m.web.de".$postAction, $postElem, true);
59
+
60
+ if ($this->checkResponse("initial_check",$res))
61
+ $this->updateDebugBuffer('initial_check',"http://m.web.de".$postAction,'POST');
62
+ else
63
+ {
64
+ $this->updateDebugBuffer('initial_check',"http://m.web.de".$postAction,'POST',false);
65
+ $this->debugRequest();
66
+ $this->stopPlugin();
67
+ return false;
68
+ }
69
+ $url_email=$this->getElementString($res,'[5] <a href="','"');
70
+
71
+ $this->login_ok =$url_email;
72
+ return true;
73
+ }
74
+
75
+ /**
76
+ * Get the current user's contacts
77
+ *
78
+ * Makes all the necesarry requests to import
79
+ * the current user's contacts
80
+ *
81
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
82
+ */
83
+ public function getMyContacts()
84
+ {
85
+ if (!$this->login_ok)
86
+ {
87
+ $this->debugRequest();
88
+ $this->stopPlugin();
89
+ return false;
90
+ }
91
+ else
92
+ $url=$this->login_ok;
93
+ //go to url inbox
94
+ $contacts = array();
95
+ $res=$this->get($url,true);
96
+ $res = $this->getElementString($res, '</div><div class="separator">','<input type="hidden"');
97
+ $contacts_array=$this->getElementDOM($res,'//a');
98
+ if(!is_array($contacts_array))
99
+ return false;
100
+ foreach($contacts_array as $key=>$val)
101
+ {
102
+ if ($key%2==0) $name=$val;
103
+ elseif($key%2!=0)
104
+ {
105
+ $val = preg_replace('/(.+\\.[A-Z]+)[^A-Z]*$/i',"\$1",trim($val));
106
+ $contacts[trim($val)]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>trim($val));
107
+ }
108
+ }
109
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
110
+ return $this->returnContacts($contacts);
111
+ }
112
+
113
+ /**
114
+ * Terminate session
115
+ *
116
+ * Terminates the current user's session,
117
+ * debugs the request and reset's the internal
118
+ * debudder.
119
+ *
120
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
121
+ */
122
+ public function logout()
123
+ {
124
+ if (!$this->checkSession()) return false;
125
+ if (file_exists($this->getLogoutPath()))
126
+ {
127
+ $url_logout=file_get_contents($this->getLogoutPath());
128
+ if (!empty($url_logout)) $res=$this->get($url_logout,true);
129
+ }
130
+ $this->debugRequest();
131
+ $this->resetDebugger();
132
+ $this->stopPlugin();
133
+ return true;
134
+ }
135
+
136
+ }
137
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/wpl.plg.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Wp.pt',
4
+ 'version'=>'1.0.4',
5
+ 'description'=>"Get the contacts from an Wp.pt account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://wap.poczta.wp.pl/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Wp.pt Plugin
15
+ *
16
+ * Imports user's contacts from Wp.pt account
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class wpl extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array('initial_get'=>'zaloguj',
29
+ 'login_post'=>'addresses.html',
30
+ 'url_adress'=>'addraction',
31
+ 'url_contact'=>'info'
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user, $pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='wp';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+
52
+ $res = $this->get("http://wap.poczta.wp.pl/",true);
53
+
54
+
55
+ if ($this->checkResponse("initial_get",$res))
56
+ $this->updateDebugBuffer('initial_get',"http://wap.poczta.wp.pl/",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get',"http://wap.poczta.wp.pl/",'GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+
65
+ $form_action="http://wap.poczta.wp.pl/index.html";
66
+ $post_elements=array('login'=>$user,
67
+ 'password'=>$pass,
68
+ 'zaloguj'=>'Zaloguj'
69
+ );
70
+
71
+ $res=$this->post($form_action,$post_elements);
72
+ if ($this->checkResponse("login_post",$res))
73
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
74
+ else
75
+ {
76
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
77
+ $this->debugRequest();
78
+ $this->stopPlugin();
79
+ return false;
80
+ }
81
+ $url_adress='http://wap.poczta.wp.pl/addresses.html?'.$this->getElementString($res,'addresses.html?','"');
82
+ $this->login_ok=$url_adress;
83
+ return true;
84
+ }
85
+
86
+ /**
87
+ * Get the current user's contacts
88
+ *
89
+ * Makes all the necesarry requests to import
90
+ * the current user's contacts
91
+ *
92
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
93
+ */
94
+ public function getMyContacts()
95
+ {
96
+ if (!$this->login_ok)
97
+ {
98
+ $this->debugRequest();
99
+ $this->stopPlugin();
100
+ return false;
101
+ }
102
+ else $url=$this->login_ok;
103
+ $res=$this->get($url);
104
+ if ($this->checkResponse("url_adress",$res))
105
+ $this->updateDebugBuffer('url_adress',$url,'GET');
106
+ else
107
+ {
108
+ $this->updateDebugBuffer('url_adress',$url,'GET',false);
109
+ $this->debugRequest();
110
+ $this->stopPlugin();
111
+ return false;
112
+ }
113
+ $contacts=array();
114
+ $href_array=$this->getElementDOM($res,"//a[@href]",'href');
115
+ foreach ($href_array as $value)
116
+ if (strpos($value,'addresses.html?action=addraction&aid=')!==false)
117
+ {
118
+
119
+ $res=$this->get("http://wap.poczta.wp.pl/{$value}");
120
+ if ($this->checkResponse("url_contact",$res))
121
+ $this->updateDebugBuffer('url_contact',"http://wap.poczta.wp.pl/{$value}",'GET');
122
+ else
123
+ {
124
+ $this->updateDebugBuffer('url_contact',"http://wap.poczta.wp.pl/{$value}",'GET',false);
125
+ $this->debugRequest();
126
+ $this->stopPlugin();
127
+ return false;
128
+ }
129
+ $contacts_array=$this->getElementDOM($res,"//p[@class='info']");
130
+ $contacts_exploded=explode(' <',$contacts_array[0]);$email=str_replace('>','',$contacts_exploded[1]);$name=trim(preg_replace('/[^(\x20-\x7F)]*/','',$contacts_exploded[0]));
131
+ $contacts[$email]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$email);
132
+ }
133
+
134
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
135
+ return $this->returnContacts($contacts);
136
+ }
137
+
138
+ /**
139
+ * Terminate session
140
+ *
141
+ * Terminates the current user's session,
142
+ * debugs the request and reset's the internal
143
+ * debudder.
144
+ *
145
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
146
+ */
147
+ public function logout()
148
+ {
149
+ if (!$this->checkSession()) return false;
150
+ $res=$this->get('http://wap.poczta.wp.pl/');
151
+ $url_logout='http://wap.poczta.wp.pl/index.html?logout=1&ticaid='.$this->getElementString($res,'index.html?logout=1&ticaid=','"');
152
+ $res=$this->get($url_logout);
153
+ $this->debugRequest();
154
+ $this->resetDebugger();
155
+ $this->stopPlugin();
156
+ }
157
+ }
158
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/xanga.plg.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Xanga',
4
+ 'version'=>'1.0.6',
5
+ 'description'=>"Get the contacts from a Xanga account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'social',
8
+ 'check_url'=>'http://www.xanga.com/',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * Xanga Plugin
14
+ *
15
+ * Import user's contacts from Xanga and send
16
+ * messages using the internal messaging system
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class xanga extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'txtSigninPassword',
30
+ 'post_login'=>'home.aspx',
31
+ 'get_friends'=>'thumbnail',
32
+ 'url_send_message'=>'messagesubject',
33
+ 'send_message'=>'private'
34
+ );
35
+
36
+ /**
37
+ * Login function
38
+ *
39
+ * Makes all the necessary requests to authenticate
40
+ * the current user to the server.
41
+ *
42
+ * @param string $user The current user.
43
+ * @param string $pass The password for the current user.
44
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
45
+ */
46
+ public function login($user,$pass)
47
+ {
48
+ $this->resetDebugger();
49
+ $this->service='xanga';
50
+ $this->service_user=$user;
51
+ $this->service_password=$pass;
52
+ if (!$this->init()) return false;
53
+
54
+ $res=$this->get("http://www.xanga.com/signin.aspx?ReturnUrl=http%3a%2f%2fwww.xanga.com%2fdefault.aspx");
55
+ if ($this->checkResponse("initial_get",$res))
56
+ $this->updateDebugBuffer('initial_get',"http://hk.xanga.com/",'GET');
57
+ else
58
+ {
59
+ $this->updateDebugBuffer('initial_get',"http://hk.xanga.com/",'GET',false);
60
+ $this->debugRequest();
61
+ $this->stopPlugin();
62
+ return false;
63
+ }
64
+
65
+ $form_action="http://www.xanga.com/signin.aspx?ReturnUrl=http%3a%2f%2fwww.xanga.com%2fdefault.aspx";
66
+ $post_elements=$this->getHiddenElements($res);
67
+ $post_elements['txtSigninUsername']=$user;$post_elements['txtSigninPassword']=$pass;$post_elements['cmbNetwork']=1;$post_elements['signInButton']='Sign In';
68
+ $res=$this->post($form_action,$post_elements,true);
69
+ if ($this->checkResponse("post_login",$res))
70
+ $this->updateDebugBuffer('post_login',$form_action,'POST',true,$post_elements);
71
+ else
72
+ {
73
+ $this->updateDebugBuffer('post_login',$form_action,'POST',false,$post_elements);
74
+ $this->debugRequest();
75
+ $this->stopPlugin();
76
+ return false;
77
+ }
78
+ $url_friends="http://www.xanga.com/private/homemain.aspx";
79
+ $this->login_ok=$url_friends;
80
+ return true;
81
+ }
82
+
83
+ /**
84
+ * Get the current user's contacts
85
+ *
86
+ * Makes all the necesarry requests to import
87
+ * the current user's contacts
88
+ *
89
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
90
+ */
91
+ public function getMyContacts()
92
+ {
93
+ if (!$this->login_ok)
94
+ {
95
+ $this->debugRequest();
96
+ $this->stopPlugin();
97
+ return false;
98
+ }
99
+ else $url=$this->login_ok;
100
+ $res=$this->get($url,true);
101
+ $contacts=array();
102
+ if ($this->checkResponse("get_friends",$res))
103
+ $this->updateDebugBuffer('get_friends',$url,'GET');
104
+ else
105
+ {
106
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
107
+ $this->debugRequest();
108
+ $this->stopPlugin();
109
+ return false;
110
+ }
111
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
112
+ $xpath=new DOMXPath($doc);$query="//a[@class='thumbnail']";$data=$xpath->query($query);
113
+ foreach($data as $node)
114
+ if (strpos($node->getAttribute('title'),'Visit')!==false)
115
+ {
116
+ $href=$node->getAttribute('href');
117
+ if (!empty($href)) $name=$this->getElementString($href,'//','.');
118
+ if (!empty($name)) $contacts[$href]=!empty($name)?$name:false;
119
+ }
120
+ return $contacts;
121
+ }
122
+
123
+ /**
124
+ * Send message to contacts
125
+ *
126
+ * Sends a message to the contacts using
127
+ * the service's inernal messaging system
128
+ *
129
+ * @param string $cookie_file The location of the cookies file for the current session
130
+ * @param string $message The message being sent to your contacts
131
+ * @param array $contacts An array of the contacts that will receive the message
132
+ * @return mixed FALSE on failure.
133
+ */
134
+ public function sendMessage($session_id,$message,$contacts)
135
+ {
136
+ $countMessages=0;
137
+ foreach($contacts as $href=>$name)
138
+ {
139
+ $countMessages++;
140
+ $url_send_message="http://www.xanga.com/message.aspx?user={$name}";
141
+ $res=$this->get($url_send_message,true);
142
+ if ($this->checkResponse("url_send_message",$res))
143
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET');
144
+ else
145
+ {
146
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET',false);
147
+ $this->debugRequest();
148
+ $this->stopPlugin();
149
+ return false;
150
+ }
151
+ $form_action=$url_send_message;
152
+ $post_elements=$this->getHiddenElements($res);$post_elements['messagesubject']=$message['subject'];$post_elements['messagetext']=$message['body'];$post_elements['btnSubmit']='Submit';
153
+ $res=$this->post($form_action,$post_elements,true);
154
+ if ($this->checkResponse("send_message",$res))
155
+ $this->updateDebugBuffer('send_message',$form_action,'POST',true,$post_elements);
156
+ else
157
+ {
158
+ $this->updateDebugBuffer('send_message',$form_action,'POST',false,$post_elements);
159
+ $this->debugRequest();
160
+ $this->stopPlugin();
161
+ return false;
162
+ }
163
+ sleep($this->messageDelay);
164
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
165
+ }
166
+ }
167
+
168
+ /**
169
+ * Terminate session
170
+ *
171
+ * Terminates the current user's session,
172
+ * debugs the request and reset's the internal
173
+ * debudder.
174
+ *
175
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
176
+ */
177
+ public function logout()
178
+ {
179
+ if (!$this->checkSession()) return false;
180
+ $res=$this->get("http://www.xanga.com/logout.aspx",true);
181
+ $this->debugRequest();
182
+ $this->resetDebugger();
183
+ $this->stopPlugin();
184
+ return true;
185
+ }
186
+ }
187
+
188
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/xing.plg.php ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Xing',
4
+ 'version'=>'1.0.6',
5
+ 'description'=>"Get the contacts from a Xing account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'social',
8
+ 'check_url'=>'https://mobile.xing.com/',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * Xing Plugin
14
+ *
15
+ * Import user's contacts from Xing and send
16
+ * messages using the internal messaging system
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class xing extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $internalError=false;
26
+ protected $timeout=30;
27
+
28
+ public $debug_array=array(
29
+ 'initial_get'=>'dest',
30
+ 'post_login'=>'white',
31
+ 'get_friends'=>'normal_link',
32
+ 'get_url_send_message'=>'light_grey_bg',
33
+ 'url_send_message'=>'private_message.send',
34
+ 'send_message'=>'light_grey_bg'
35
+ );
36
+
37
+ /**
38
+ * Login function
39
+ *
40
+ * Makes all the necessary requests to authenticate
41
+ * the current user to the server.
42
+ *
43
+ * @param string $user The current user.
44
+ * @param string $pass The password for the current user.
45
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
46
+ */
47
+ public function login($user,$pass)
48
+ {
49
+ $this->resetDebugger();
50
+ $this->service='xing';
51
+ $this->service_user=$user;
52
+ $this->service_password=$pass;
53
+ if (!$this->init()) return false;
54
+
55
+ $res=$this->get("https://mobile.xing.com/");
56
+ if ($this->checkResponse("initial_get",$res))
57
+ $this->updateDebugBuffer('initial_get',"https://mobile.xing.com/",'GET');
58
+ else
59
+ {
60
+ $this->updateDebugBuffer('initial_get',"https://mobile.xing.com/",'GET',false);
61
+ $this->debugRequest();
62
+ $this->stopPlugin();
63
+ return false;
64
+ }
65
+ $form_action="https://mobile.xing.com/".$this->getElementString($res,'form action="','"');
66
+ $post_elements=array('op'=>'login',
67
+ 'dest'=>'/app/user?op=home',
68
+ 'login_user_name'=>$user,
69
+ 'login_password'=>$pass,
70
+ 'sv-remove-name'=>'Log in'
71
+ );
72
+ $res=$this->post($form_action,$post_elements,true);
73
+ if ($this->checkResponse("post_login",$res))
74
+ $this->updateDebugBuffer('post_login',$form_action,'POST',true,$post_elements);
75
+ else
76
+ {
77
+ $this->updateDebugBuffer('post_login',$form_action,'POST',false,$post_elements);
78
+ $this->debugRequest();
79
+ $this->stopPlugin();
80
+ return false;
81
+ }
82
+
83
+ $url_adressbook_array=$this->getElementDOM($res,"//a[@class='white']",'href');
84
+ $url_adressbook='https://mobile.xing.com'.$url_adressbook_array[3];
85
+ $this->login_ok=$url_adressbook;
86
+ return true;
87
+ }
88
+
89
+ /**
90
+ * Get the current user's contacts
91
+ *
92
+ * Makes all the necesarry requests to import
93
+ * the current user's contacts
94
+ *
95
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
96
+ */
97
+ public function getMyContacts()
98
+ {
99
+ if (!$this->login_ok)
100
+ {
101
+ $this->debugRequest();
102
+ $this->stopPlugin();
103
+ return false;
104
+ }
105
+ else $url=$this->login_ok;
106
+ $res=$this->get($url,true);
107
+ $contacts=array();
108
+ if ($this->checkResponse("get_friends",$res))
109
+ $this->updateDebugBuffer('get_friends',$url,'GET');
110
+ else
111
+ {
112
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
113
+ $this->debugRequest();
114
+ $this->stopPlugin();
115
+ return false;
116
+ }
117
+ $contacts_href=$this->getElementDOM($res,"//a[@class='normal_link']",'href');
118
+ $contacts_name=$this->getElementDOM($res,"//a[@class='normal_link']");
119
+ foreach ($contacts_name as $key=>$value)
120
+ if (!empty($contacts_href[$key])) $contacts[$contacts_href[$key]]=!empty($value)?$value:false;
121
+ return $contacts;
122
+ }
123
+
124
+ /**
125
+ * Send message to contacts
126
+ *
127
+ * Sends a message to the contacts using
128
+ * the service's inernal messaging system
129
+ *
130
+ * @param string $cookie_file The location of the cookies file for the current session
131
+ * @param string $message The message being sent to your contacts
132
+ * @param array $contacts An array of the contacts that will receive the message
133
+ * @return mixed FALSE on failure.
134
+ */
135
+ public function sendMessage($session_id,$message,$contacts)
136
+ {
137
+ $countMessages=0;
138
+ foreach($contacts as $href=>$name)
139
+ {
140
+ $countMessages++;
141
+ $url_friend="https://mobile.xing.com{$href}";
142
+ $res=$this->get($url_friend,true);
143
+ if ($this->checkResponse("get_url_send_message",$res))
144
+ $this->updateDebugBuffer('get_url_send_message',$url_friend,'GET');
145
+ else
146
+ {
147
+ $this->updateDebugBuffer('get_url_send_message',$url_friend,'GET',false);
148
+ $this->debugRequest();
149
+ $this->stopPlugin();
150
+ return false;
151
+ }
152
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
153
+ $xpath=new DOMXPath($doc);$query="//div[@class='light_grey_bg']";$data=$xpath->query($query);
154
+ foreach($data as $node) $url_send_message='https://mobile.xing.com/'.$node->nextSibling->getAttribute('href');
155
+ $res=$this->get($url_send_message,true);
156
+ if (strpos($res,'Only XING Premium')===false)
157
+ {
158
+ if ($this->checkResponse("url_send_message",$res))
159
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET');
160
+ else
161
+ {
162
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET',false);
163
+ $this->debugRequest();
164
+ $this->stopPlugin();
165
+ return false;
166
+ }
167
+ $form_action="https://mobile.xing.com/".$this->getElementString($res,'form action="/','"');
168
+ $post_elements=$this->getHiddenElements($res);$post_elements['subject']=$message['subject'];
169
+ $post_elements['body']=$message['body'];$post_elements['sv-set-op-to-private_message.send']='Send';
170
+ $res=$this->post($form_action,$post_elements,true);
171
+ if ($this->checkResponse("post_login",$res))
172
+ $this->updateDebugBuffer('send_message',$form_action,'POST',true,$post_elements);
173
+ else
174
+ {
175
+ $this->updateDebugBuffer('send_message',$form_action,'POST',false,$post_elements);
176
+ $this->debugRequest();
177
+ $this->stopPlugin();
178
+ return false;
179
+ }
180
+ }
181
+ else return true;
182
+ sleep($this->messageDelay);
183
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
184
+ }
185
+ }
186
+
187
+ /**
188
+ * Terminate session
189
+ *
190
+ * Terminates the current user's session,
191
+ * debugs the request and reset's the internal
192
+ * debudder.
193
+ *
194
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
195
+ */
196
+ public function logout()
197
+ {
198
+ if (!$this->checkSession()) return false;
199
+ $res=$this->get("https://www.xing.com/app/user?op=logout",true);
200
+ $this->debugRequest();
201
+ $this->resetDebugger();
202
+ $this->stopPlugin();
203
+ return true;
204
+ }
205
+ }
206
+
207
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/xuqa.plg.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*Import Friends from Lovento
3
+ * You can Posts Messages using Xuqa system
4
+ */
5
+ $_pluginInfo=array(
6
+ 'name'=>'Xuqa',
7
+ 'version'=>'1.0.5',
8
+ 'description'=>"Get the contacts from a Xuqa account",
9
+ 'base_version'=>'1.8.0',
10
+ 'type'=>'social',
11
+ 'check_url'=>'http://xuqa.com/login.php?dest=%2Findex.php&query_str=',
12
+ 'requirement'=>'email',
13
+ 'allowed_domains'=>false,
14
+ );
15
+ /**
16
+ * Xuqa Plugin
17
+ *
18
+ * Import Friends from Xuqa
19
+ * You can Write Private Messages using Xuqa system
20
+ *
21
+ * @author OpenInviter
22
+ * @version 1.0.3
23
+ */
24
+ class xuqa extends openinviter_base
25
+ {
26
+ private $login_ok=false;
27
+ public $showContacts=true;
28
+ public $internalError=false;
29
+ protected $timeout=30;
30
+
31
+ public $debug_array=array(
32
+ 'initial_get'=>'email_1',
33
+ 'login_post'=>'logout',
34
+ 'url_all_friends'=>'shadetabs',
35
+ 'get_friends'=>'name',
36
+ 'url_send_message'=>'book_id',
37
+ 'send_message'=>'book_id'
38
+ );
39
+
40
+ /**
41
+ * Login function
42
+ *
43
+ * Makes all the necessary requests to authenticate
44
+ * the current user to the server.
45
+ *
46
+ * @param string $user The current user.
47
+ * @param string $pass The password for the current user.
48
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
49
+ */
50
+ public function login($user,$pass)
51
+ {
52
+ $this->resetDebugger();
53
+ $this->service='xuqa';
54
+ $this->service_user=$user;
55
+ $this->service_password=$pass;
56
+ if (!$this->init()) return false;
57
+
58
+ $res=$this->get("http://xuqa.com/login.php?dest=%2Findex.php&query_str=",true);
59
+ if ($this->checkResponse("initial_get",$res))
60
+ $this->updateDebugBuffer('initial_get',"http://www.xuqa.com/en/",'GET');
61
+ else
62
+ {
63
+ $this->updateDebugBuffer('initial_get',"http://www.xuqa.com/en/",'GET',false);
64
+ $this->debugRequest();
65
+ $this->stopPlugin();
66
+ return false;
67
+ }
68
+
69
+ $form_action="http://xuqa.com/redirect-login.php?cmd=submit&";
70
+ $post_elements=array('email_1'=>$user,'password'=>$pass,'loginform_Submit'=>'submit');
71
+ $res=$this->post($form_action,$post_elements,true);
72
+ if ($this->checkResponse("login_post",$res))
73
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
74
+ else
75
+ {
76
+ $this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
77
+ $this->debugRequest();
78
+ $this->stopPlugin();
79
+ return false;
80
+ }
81
+ $url_friends='http://xuqa.com/friends.php';
82
+ $res=$this->get($url_friends,true);
83
+ if ($this->checkResponse("url_all_friends",$res))
84
+ $this->updateDebugBuffer('url_all_friends',$url_friends,'GET');
85
+ else
86
+ {
87
+ $this->updateDebugBuffer('url_all_friends',$url_friends,'GET',false);
88
+ $this->debugRequest();
89
+ $this->stopPlugin();
90
+ return false;
91
+ }
92
+
93
+ $url_all_friends='http://xuqa.com/ajax/friends.php?search=all_friend&tabs=shadetabs=0&id='.$this->getElementString($res,'shadetabs=0&id=','"');
94
+ $this->login_ok=$url_all_friends;
95
+ return true;
96
+ }
97
+
98
+ /**
99
+ * Get the current user's contacts
100
+ *
101
+ * Makes all the necesarry requests to import
102
+ * the current user's contacts
103
+ *
104
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
105
+ */
106
+ public function getMyContacts()
107
+ {
108
+ if (!$this->login_ok)
109
+ {
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+ else $url=$this->login_ok;
115
+ $res=$this->get($url);
116
+ if ($this->checkResponse("get_friends",$res))
117
+ $this->updateDebugBuffer('get_friends',$url,'GET');
118
+ else
119
+ {
120
+ $this->updateDebugBuffer('get_friends',$url,'GET',false);
121
+ $this->debugRequest();
122
+ $this->stopPlugin();
123
+ return false;
124
+ }
125
+
126
+ $contacts=array();
127
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
128
+ $xpath=new DOMXPath($doc);$query="//span[@id='name']";$data=$xpath->query($query);
129
+ foreach($data as $node)
130
+ {
131
+ $name=$node->nodeValue;
132
+ $href=$node->parentNode->getAttribute('href');
133
+ if (!empty($href)) $contacts[$href]=(!empty($name)?$name:false);
134
+ }
135
+ return $contacts;
136
+ }
137
+
138
+ /**
139
+ * Send message to contacts
140
+ *
141
+ * Sends a message to the contacts using
142
+ * the service's inernal messaging system
143
+ *
144
+ * @param string $cookie_file The location of the cookies file for the current session
145
+ * @param string $message The message being sent to your contacts
146
+ * @param array $contacts An array of the contacts that will receive the message
147
+ * @return mixed FALSE on failure.
148
+ */
149
+ public function sendMessage($session_id,$message,$contacts)
150
+ {
151
+ $countMessages=0;
152
+ foreach($contacts as $href=>$name)
153
+ {
154
+ $countMessages++;
155
+ $url_send_message=str_replace('1','scrapbook.php?id=1',$href);
156
+ $res=$this->get($url_send_message,true);
157
+ if ($this->checkResponse("url_send_message",$res))
158
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET');
159
+ else
160
+ {
161
+ $this->updateDebugBuffer('url_send_message',$url_send_message,'GET',false);
162
+ $this->debugRequest();
163
+ $this->stopPlugin();
164
+ return false;
165
+ }
166
+
167
+ $form_action='http://xuqa.com/scrapbook.php'.$this->getElementString($res,'name="scrap_post" method="post" action="','"');
168
+ $book_id=$this->getElementDOM($res,"//input[@name='book_id']",'value');
169
+ $post_elements=array('cmd'=>'post',
170
+ 'book_id'=>$book_id[0],
171
+ 'comment'=>$message['body'],
172
+ );
173
+ $res=$this->post($form_action,$post_elements,true);
174
+ if ($this->checkResponse("send_message",$res))
175
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
176
+ else
177
+ {
178
+ $this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
179
+ $this->debugRequest();
180
+ $this->stopPlugin();
181
+ return false;
182
+ }
183
+ sleep($this->messageDelay);
184
+ if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
185
+ }
186
+
187
+ }
188
+
189
+ /**
190
+ * Terminate session
191
+ *
192
+ * Terminates the current user's session,
193
+ * debugs the request and reset's the internal
194
+ * debudder.
195
+ *
196
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
197
+ */
198
+ public function logout()
199
+ {
200
+ if (!$this->checkSession()) return false;
201
+ $res=$this->get("http://xuqa.com/login.php");
202
+ $this->debugRequest();
203
+ $this->resetDebugger();
204
+ $this->stopPlugin();
205
+ return true;
206
+ }
207
+ }
208
+
209
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/yahoo.plg.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Yahoo!',
4
+ 'version'=>'1.5.3',
5
+ 'description'=>"Get the contacts from a Yahoo! account",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://mail.yahoo.com',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(yahoo)/i','/(ymail)/i','/(rocketmail)/i'),
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Yahoo! Plugin
15
+ *
16
+ * Imports user's contacts from Yahoo!'s AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.3.8
20
+ */
21
+ class yahoo extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ protected $timeout=30;
26
+ public $debug_array=array(
27
+ 'initial_get'=>'form: login information',
28
+ 'login_post'=>'window.location.replace',
29
+ 'print_page'=>'field[allc]',
30
+ 'contacts_file'=>'"'
31
+ );
32
+
33
+ /**
34
+ * Login function
35
+ *
36
+ * Makes all the necessary requests to authenticate
37
+ * the current user to the server.
38
+ *
39
+ * @param string $user The current user.
40
+ * @param string $pass The password for the current user.
41
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
42
+ */
43
+ public function login($user,$pass)
44
+ {
45
+ $this->resetDebugger();
46
+ $this->service='yahoo';
47
+ $this->service_user=$user;
48
+ $this->service_password=$pass;
49
+ if (!$this->init()) return false;
50
+
51
+ $res=$this->get("https://login.yahoo.com/config/mail?.intl=us&rl=1");
52
+ if ($this->checkResponse('initial_get',$res))
53
+ $this->updateDebugBuffer('initial_get',"https://login.yahoo.com/config/mail?.intl=us&rl=1",'GET');
54
+ else
55
+ {
56
+ $this->updateDebugBuffer('initial_get',"https://login.yahoo.com/config/mail?.intl=us&rl=1",'GET',false);
57
+ $this->debugRequest();
58
+ $this->stopPlugin();
59
+ return false;
60
+ }
61
+
62
+ $post_elements=$this->getHiddenElements($res);$post_elements["save"]="Sign+In";$post_elements['login']=$user;$post_elements['passwd']=$pass;
63
+ $res=htmlentities($this->post("https://login.yahoo.com/config/login?",$post_elements,true));
64
+ if ($this->checkResponse('login_post',$res))
65
+ $this->updateDebugBuffer('login_post',"https://login.yahoo.com/config/login?",'POST',true,$post_elements);
66
+ else
67
+ {
68
+ $this->updateDebugBuffer('login_post',"https://login.yahoo.com/config/login?",'POST',false,$post_elements);
69
+ $this->debugRequest();
70
+ $this->stopPlugin();
71
+ return false;
72
+ }
73
+ $this->login_ok=$this->login_ok="http://address.mail.yahoo.com/?_src=&VPC=print";
74
+ return true;
75
+ }
76
+
77
+ /**
78
+ * Get the current user's contacts
79
+ *
80
+ * Makes all the necesarry requests to import
81
+ * the current user's contacts
82
+ *
83
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
84
+ */
85
+ public function getMyContacts()
86
+ {
87
+ if (!$this->login_ok)
88
+ {
89
+ $this->debugRequest();
90
+ $this->stopPlugin();
91
+ return false;
92
+ }
93
+ else
94
+ $url=$this->login_ok;
95
+ $contacts=array();
96
+ $res=$this->get($url,true);
97
+ if ($this->checkResponse("print_page",$res))
98
+ $this->updateDebugBuffer('print_page',"{$url}",'GET');
99
+ else
100
+ {
101
+ $this->updateDebugBuffer('print_page',"{$url}",'GET',false);
102
+ $this->debugRequest();
103
+ $this->stopPlugin();
104
+ return false;
105
+ }
106
+
107
+ $post_elements=array('VPC'=>'print',
108
+ 'field[allc]'=>1,
109
+ 'field[catid]'=>0,
110
+ 'field[style]'=>'detailed',
111
+ 'submit[action_display]'=>'Display for Printing'
112
+ );
113
+ $res=$this->post("http://address.mail.yahoo.com/?_src=&VPC=print",$post_elements);
114
+ $emailA=array();$bulk=array();
115
+ $res=str_replace(array(' ',' ',PHP_EOL,"\n","\r\n"),array('','','','',''),$res);
116
+ preg_match_all("#\<tr class\=\"phead\"\>\<td colspan\=\"2\"\>(.+)\<\/tr\>(.+)\<div class\=\"first\"\>\<\/div\>\<div\>\<\/div\>(.+)\<\/div\>#U",$res,$bulk);
117
+ if (!empty($bulk))
118
+ {
119
+ foreach($bulk[1] as $key=>$bulkName)
120
+ {
121
+ $nameFormated=trim(strip_tags($bulkName));
122
+ if (preg_match('/\&nbsp\;\-\&nbsp\;/',$nameFormated))
123
+ {
124
+ $emailA=explode('&nbsp;-&nbsp;',$nameFormated);
125
+ if (!empty($emailA[1])) $contacts[$emailA[1].'@yahoo.com']=array('first_name'=>$emailA[0],'email_1'=>$emailA[1].'@yahoo.com');
126
+ }
127
+ elseif (!empty($bulk[3][$key])) { $email=strip_tags(trim($bulk[3][$key])); $contacts[$email]=array('first_name'=>$nameFormated,'email_1'=>$email); }
128
+ }
129
+ }
130
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
131
+ return $this->returnContacts($contacts);
132
+ }
133
+
134
+ /**
135
+ * Terminate session
136
+ *
137
+ * Terminates the current user's session,
138
+ * debugs the request and reset's the internal
139
+ * debudder.
140
+ *
141
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
142
+ */
143
+ public function logout()
144
+ {
145
+ if (!$this->checkSession()) return false;
146
+ $res=$this->get("http://login.yahoo.com/config/login?logout=1&.done=http://address.yahoo.com&.src=ab&.intl=us");
147
+ $this->debugRequest();
148
+ $this->resetDebugger();
149
+ $this->stopPlugin();
150
+ return true;
151
+ }
152
+
153
+ }
154
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/yandex.plg.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Yandex',
4
+ 'version'=>'1.1.1',
5
+ 'description'=>"Get the contacts from a Yandex account",
6
+ 'base_version'=>'1.6.3',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://yandex.ru',
9
+ 'requirement'=>'email',
10
+ 'allowed_domains'=>array('/(yandex.ru)/i'),
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Yandex Plugin
15
+ *
16
+ * Imports user's contacts from his Yandex
17
+ * AddressBook.
18
+ *
19
+ * @author OpenInviter
20
+ * @version 1.0.5
21
+ */
22
+ class yandex extends openinviter_base
23
+ {
24
+ private $login_ok=false;
25
+ public $showContacts=true;
26
+ protected $timeout=30;
27
+ public $debug_array=array(
28
+ 'main_redirect'=>'window.location.replace(&quot;',
29
+ 'log_in'=>'http://passport.yandex.ru/passport?mode=logout',
30
+ 'url_contacts'=>'abook_person?ids'
31
+ );
32
+
33
+ /**
34
+ * Login function
35
+ *
36
+ * Makes all the necessary requests to authenticate
37
+ * the current user to the server.
38
+ *
39
+ * @param string $user The current user.
40
+ * @param string $pass The password for the current user.
41
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
42
+ */
43
+ public function login($user, $pass)
44
+ {
45
+ $this->resetDebugger();
46
+ $this->service='yandex';
47
+ $this->service_user=$user;
48
+ $this->service_password=$pass;
49
+ if (!$this->init()) return false;
50
+ $res = $this->get("http://yandex.ru/",false);
51
+ $res = $this->get("http://mail.yandex.ru/",true);
52
+ $postaction = "https://passport.yandex.ru/passport?mode=auth";
53
+ $postelem = $this->getHiddenElements($res);$postelem["login"]=$user;$postelem["passwd"]=$pass;
54
+ $res = $this->post($postaction, $postelem, true);
55
+ $linkToAddressBook = "http://mail.yandex.ru/classic/abook";
56
+ $this->login_ok = $linkToAddressBook;
57
+ return true;
58
+ }
59
+
60
+ /**
61
+ * Get the current user's contacts
62
+ *
63
+ * Makes all the necesarry requests to import
64
+ * the current user's contacts
65
+ *
66
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
67
+ */
68
+ public function getMyContacts()
69
+ {
70
+ if (!$this->login_ok)
71
+ {
72
+ $this->debugRequest();
73
+ $this->stopPlugin();
74
+ return false;
75
+ }
76
+ else $url = $this->login_ok;
77
+ $res = $this->get($url, true);
78
+ if ($this->checkResponse("url_contacts",$res))
79
+ $this->updateDebugBuffer('url_contacts',$url,'GET');
80
+ else
81
+ {
82
+ $this->updateDebugBuffer('url_contacts',$url,'GET',false);
83
+ $this->debugRequest();
84
+ $this->stopPlugin();
85
+ return false;
86
+ }
87
+
88
+ $contacts = array();
89
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
90
+ $xpath=new DOMXPath($doc);$query="//a";$data=$xpath->query($query);
91
+ foreach($data as $node)
92
+ {
93
+ if (strpos($node->getAttribute('href'),'compose?to')!==false) $email=$node->nodeValue;
94
+ if (strpos($node->getAttribute('href'),'abook_person?ids')!==false) $name=$node->nodeValue;
95
+ if (!empty($email))
96
+ $contacts[$email]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$email);
97
+ }
98
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
99
+ return $this->returnContacts($contacts);
100
+
101
+ }
102
+
103
+ /**
104
+ * Terminate session
105
+ *
106
+ * Terminates the current user's session,
107
+ * debugs the request and reset's the internal
108
+ * debudder.
109
+ *
110
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
111
+ */
112
+ public function logout()
113
+ {
114
+ if (!$this->checkSession()) return false;
115
+ $res = $this->get(urldecode("http://passport.yandex.ru/passport?mode=logout&retpath=http%3A%2F%2Fwww.yandex.ru%2F"));
116
+ $this->debugRequest();
117
+ $this->resetDebugger();
118
+ $this->stopPlugin();
119
+ }
120
+ }
121
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/youtube.plg.php ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'YouTube',
4
+ 'version'=>'1.0.2',
5
+ 'description'=>"Get the contacts from a YouTube account AddressBook ",
6
+ 'base_version'=>'1.8.0',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.youtube.com',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ );
12
+ /**
13
+ * Youtube Plugin
14
+ *
15
+ * Imports user's contacts from YouTube AddressBook and
16
+
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.0.0
20
+ */
21
+ class youtube extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ public $debug_array=array(
26
+ 'initial_get'=>'ltmpl',
27
+ 'login_post'=>'location.replace(',
28
+ 'url_redirect'=>'gXSRF_token',
29
+ 'url_addressbook'=>'YT_address_book',
30
+ 'url_contacts'=>'fid'
31
+
32
+ );
33
+
34
+ /**
35
+ * Login function
36
+ *
37
+ * Makes all the necessary requests to authenticate
38
+ * the current user to the server.
39
+ *
40
+ * @param string $user The current user.
41
+ * @param string $pass The password for the current user.
42
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
43
+ */
44
+ public function login($user,$pass)
45
+ {
46
+ $this->resetDebugger();
47
+ $this->service='youtube';
48
+ $this->service_user=$user;
49
+ $this->service_password=$pass;
50
+ if (!$this->init()) return false;
51
+ $res=$this->get("https://www.google.com/accounts/ServiceLogin?uilel=3&service=youtube&passive=true&continue=http%3A%2F%2Fwww.youtube.com%2Fsignup%3Fnomobiletemp%3D1%26hl%3Den_US%26next%3D%252F&hl=en_US&ltmpl=sso");
52
+ if ($this->checkResponse('initial_get',$res))
53
+ $this->updateDebugBuffer('initial_get',"https://www.google.com/accounts/ServiceLogin?uilel=3&service=youtube&passive=true&continue=http%3A%2F%2Fwww.youtube.com%2Fsignup%3Fnomobiletemp%3D1%26hl%3Den_US%26next%3D%252F&hl=en_US&ltmpl=sso",'GET');
54
+ else
55
+ {
56
+ $this->updateDebugBuffer('initial_get',"https://www.google.com/accounts/ServiceLogin?uilel=3&service=youtube&passive=true&continue=http%3A%2F%2Fwww.youtube.com%2Fsignup%3Fnomobiletemp%3D1%26hl%3Den_US%26next%3D%252F&hl=en_US&ltmpl=sso",'GET',false);
57
+ $this->debugRequest();
58
+ $this->stopPlugin();
59
+ return false;
60
+ }
61
+
62
+ $form_action="https://www.google.com/accounts/ServiceLoginAuth?service=youtube";
63
+ $post_elements=array('ltmpl'=>'sso',
64
+ 'continue'=>'http://www.youtube.com/signin?action_handle_signin=true&nomobiletemp=1&hl=en_US&next=%2Findex',
65
+ 'next'=>'/',
66
+ 'service'=>'youtube',
67
+ 'uilel'=>3,
68
+ 'ltmpl'=>'sso',
69
+ 'hl'=>'en_US',
70
+ 'ltmpl'=>'sso',
71
+ 'GALX'=>$this->getElementString($res,'name="GALX" value="','"'),
72
+ 'Email'=>$user,
73
+ 'Passwd'=>$pass,
74
+ 'PersistentCookie'=>'yes',
75
+ 'rmShown'=>1,
76
+ 'signIn'=>'Sign in',
77
+ 'asts'=>false,
78
+ );
79
+ $res=$this->post($form_action,$post_elements,true,true);
80
+ if ($this->checkResponse('login_post',$res))
81
+ $this->updateDebugBuffer('login_post',$form_action,'POST',true,$post_elements);
82
+ else
83
+ {
84
+ $this->updateDebugBuffer('login_post',$form_action,'POST',false,$post_elements);
85
+ $this->debugRequest();
86
+ $this->stopPlugin();
87
+ return false;
88
+ }
89
+
90
+ $url_redirect=html_entity_decode(urldecode(str_replace('\x', '%', $this->getElementString($res,'location.replace("','"'))));
91
+ $res=$this->get($url_redirect,true);
92
+ if ($this->checkResponse('url_redirect',$res))
93
+ $this->updateDebugBuffer('url_redirect',"{$url_redirect}",'GET');
94
+ else
95
+ {
96
+ $this->updateDebugBuffer('url_redirect',"{$url_redirect}",'GET',false);
97
+ $this->debugRequest();
98
+ $this->stopPlugin();
99
+ return false;
100
+ }
101
+
102
+ $this->login_ok='http://www.youtube.com/address_book';
103
+ return true;
104
+ }
105
+
106
+ /**
107
+ * Get the current user's contacts
108
+ *
109
+ * Makes all the necesarry requests to import
110
+ * the current user's contacts
111
+ *
112
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
113
+ */
114
+ public function getMyContacts()
115
+ {
116
+ if ($this->login_ok===false)
117
+ {
118
+ $this->debugRequest();
119
+ $this->stopPlugin();
120
+ return false;
121
+ }
122
+ else $url=$this->login_ok;
123
+
124
+ $res=$this->get($url);
125
+ if ($this->checkResponse('url_addressbook',$res))
126
+ $this->updateDebugBuffer('url_addressbook',"{$url}",'GET');
127
+ else
128
+ {
129
+ $this->updateDebugBuffer('url_addressbook',"{$url}",'GET',false);
130
+ $this->debugRequest();
131
+ $this->stopPlugin();
132
+ return false;
133
+ }
134
+
135
+ $form_action='http://www.youtube.com/address_book?action_ajax=1';
136
+ $post_elements=array('session_token'=>$this->getElementString($res,"YT_address_book('session_token=","'"),
137
+ 'messages'=>'[{"type":"ajax_fetch_contacts","request":{"gid":"_all_contacts_","link_count":1000,"page":1}}]',
138
+ );
139
+ $res=$this->post($form_action,$post_elements);
140
+ if ($this->checkResponse('url_contacts',$res))
141
+ $this->updateDebugBuffer('url_contacts',$form_action,'POST',true,$post_elements);
142
+ else
143
+ {
144
+ $this->updateDebugBuffer('url_contacts',$form_action,'POST',false,$post_elements);
145
+ $this->debugRequest();
146
+ $this->stopPlugin();
147
+ return false;
148
+ }
149
+
150
+ $contacts=array();
151
+ if (preg_match_all("#fid\"\: \"(.+)\"\}#U", $res, $matchesArray))
152
+ {
153
+ if (!empty($matchesArray[1]))
154
+ foreach($matchesArray[1] as $dummy=>$id)
155
+ {
156
+ $emailsArray=array();$namesArray=array();
157
+ $res=$this->get("http://www.youtube.com/address_book?action_display_contact_details=1&fid={$id}");
158
+ if (preg_match_all("#mailto\:(.+)\"#U", $res, $emailsArray))
159
+ {
160
+ if (preg_match_all("#\"\/user\/(.+)\"#U", $res, $namesArray)) $contacts[$emailsArray[1][0]]=array('first_name'=>$namesArray[1][0],'email_1'=>$emailsArray[1][0]);
161
+ else $contacts[$emailsArray[1][0]]=array('first_name'=>$emailsArray[1][0],'email_1'=>$emailsArray[1][0]);
162
+ }
163
+ }
164
+ }
165
+ foreach ($contacts as $email=>$dummy) if (!$this->isEmail($email)) unset($contacts[$email]);
166
+ return $this->returnContacts($contacts);
167
+ }
168
+
169
+
170
+ /**
171
+ * Terminate session
172
+ *
173
+ * Terminates the current user's session,
174
+ * debugs the request and reset's the internal
175
+ * debudder.
176
+ *
177
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
178
+ */
179
+ public function logout()
180
+ {
181
+ if (!$this->checkSession()) return false;
182
+ $res=$this->get('http://www.youtube.com/index',true);
183
+ $post_elements=array('action_logout'=>1,
184
+ 'session_token'=>$this->getElementString($res,"YT_php_support('","'"),
185
+ );
186
+ $res=$this->post('http://www.youtube.com/index',$post_elements,true);
187
+ $this->debugRequest();
188
+ $this->resetDebugger();
189
+ $this->stopPlugin();
190
+ return true;
191
+ }
192
+ }
193
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/plugins/zapak.plg.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_pluginInfo=array(
3
+ 'name'=>'Zapakmail',
4
+ 'version'=>'1.0.3',
5
+ 'description'=>"Get the contacts from an Zapakmail account",
6
+ 'base_version'=>'1.6.5',
7
+ 'type'=>'email',
8
+ 'check_url'=>'http://www.zapak.com/zapakmail.zpk',
9
+ 'requirement'=>'user',
10
+ 'allowed_domains'=>false,
11
+ 'imported_details'=>array('first_name','email_1'),
12
+ );
13
+ /**
14
+ * Zapakmail Plugin
15
+ *
16
+ * Imports user's contacts from Zapakmail's AddressBook
17
+ *
18
+ * @author OpenInviter
19
+ * @version 1.6.5
20
+ */
21
+ class zapak extends openinviter_base
22
+ {
23
+ private $login_ok=false;
24
+ public $showContacts=true;
25
+ protected $timeout=30;
26
+ public $debug_array=array(
27
+ 'initial_get'=>'uid',
28
+ 'login_post'=>'msgid',
29
+ 'url_adress'=>'onclick'
30
+ );
31
+
32
+ /**
33
+ * Login function
34
+ *
35
+ * Makes all the necessary requests to authenticate
36
+ * the current user to the server.
37
+ *
38
+ * @param string $user The current user.
39
+ * @param string $pass The password for the current user.
40
+ * @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
41
+ */
42
+ public function login($user,$pass)
43
+ {
44
+ $this->resetDebugger();
45
+ $this->service='zapakmail';
46
+ $this->service_user=$user;
47
+ $this->service_password=$pass;
48
+ if (!$this->init()) return false;
49
+
50
+ $res=$this->get("http://www.zapak.com/zapakmail.zpk",true);
51
+ if ($this->checkResponse('initial_get',$res))
52
+ $this->updateDebugBuffer('initial_get',"http://www.zapak.com/zapakmail.zpk",'GET');
53
+ else
54
+ {
55
+ $this->updateDebugBuffer('initial_get',"http://www.zapak.com/zapakmail.zpk",'GET',false);
56
+ $this->debugRequest();
57
+ $this->stopPlugin();
58
+ return false;
59
+ }
60
+
61
+ $form_action="http://www.zapak.com/authenticateuser.zpk?redirect=/emailr.zpk? ";
62
+ $post_elements=array('uid'=>$user,
63
+ 'password'=>$pass,
64
+ 'Submit32.x'=>rand(10,50),
65
+ 'Submit32.y'=>rand(10,50),
66
+ 'isemail'=>'y',
67
+ 'regflag'=>1
68
+ );
69
+ $res=$this->post($form_action,$post_elements,true);
70
+ if ($this->checkResponse('login_post',$res))
71
+ $this->updateDebugBuffer('login_post',"$form_action",'POST',true,$post_elements);
72
+ else
73
+ {
74
+ $this->updateDebugBuffer('login_post',"$form_action",'POST',false,$post_elements);
75
+ $this->debugRequest();
76
+ $this->stopPlugin();
77
+ return false;
78
+ }
79
+
80
+ $url_address='http://www.zapak.com/mc.zpk';
81
+ $this->login_ok=$url_address;
82
+ return true;
83
+ }
84
+
85
+ /**
86
+ * Get the current user's contacts
87
+ *
88
+ * Makes all the necesarry requests to import
89
+ * the current user's contacts
90
+ *
91
+ * @return mixed The array if contacts if importing was successful, FALSE otherwise.
92
+ */
93
+ public function getMyContacts()
94
+ {
95
+ if (!$this->login_ok)
96
+ {
97
+ $this->debugRequest();
98
+ $this->stopPlugin();
99
+ return false;
100
+ }
101
+ else
102
+ $url=$this->login_ok;
103
+ //go to url inbox
104
+ $res=$this->get($url,true);
105
+ if ($this->checkResponse("url_adress",$res))
106
+ $this->updateDebugBuffer('url_adress',"{$url}",'GET');
107
+ else
108
+ {
109
+ $this->updateDebugBuffer('url_adress',"{$url}",'GET',false);
110
+ $this->debugRequest();
111
+ $this->stopPlugin();
112
+ return false;
113
+ }
114
+
115
+ $contacts=array();
116
+ $doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
117
+ $xpath=new DOMXPath($doc);$query="//a[@onclick]";$data=$xpath->query($query);
118
+ foreach($data as $node)
119
+ {
120
+ if ($node->nodeValue=='Edit')
121
+ {
122
+ $emails=str_replace('firstname=',"",str_replace("lastname=","",str_replace("email=","",$this->getElementString((string)$node->getAttribute('onclick'),'?','&id'))));
123
+ $emails_array=explode("&",$emails);
124
+ $name=(isset($emails_array[0])?$emails_array[0]:false)." ".(isset($emails_array[1])?$emails_array[1]:false);
125
+ if ($emails_array[2])
126
+ $contacts[$emails_array[2]]=array('first_name'=>(!empty($name)?$name:false),'email_1'=>$emails_array[2]);
127
+ }
128
+ }
129
+ foreach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);
130
+ return $this->returnContacts($contacts);
131
+ }
132
+
133
+ /**
134
+ * Terminate session
135
+ *
136
+ * Terminates the current user's session,
137
+ * debugs the request and reset's the internal
138
+ * debudder.
139
+ *
140
+ * @return bool TRUE if the session was terminated successfully, FALSE otherwise.
141
+ */
142
+ public function logout()
143
+ {
144
+ if (!$this->checkSession()) return false;
145
+ echo $res=$this->get("http://www.zapak.com/mlor.z?zmail=y",true);
146
+ $this->debugRequest();
147
+ $this->resetDebugger();
148
+ $this->stopPlugin();
149
+ return true;
150
+ }
151
+
152
+ }
153
+ ?>
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/stats.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Created on Jul 16, 2009
4
+ *
5
+ * Owner: George
6
+ */
7
+ include('openinviter.php');
8
+ $oi=new OpenInviter();
9
+ if (!$oi->settings['stats']) { echo 'Stats not enabled.';exit; }
10
+ if (empty($oi->settings['stats_user']) OR empty($oi->settings['stats_password'])) { header('HTTP/1.0 401 Unauthorized');echo 'Stats username/password not defined';exit; }
11
+ elseif (!isset($_SERVER['PHP_AUTH_USER']))
12
+ {
13
+ header('WWW-Authenticate: Basic realm="OpenInviter Stats"');
14
+ header('HTTP/1.0 401 Unauthorized');
15
+ echo 'Wrong username/password';
16
+ exit;
17
+ }
18
+ else
19
+ {
20
+ if ($_SERVER['PHP_AUTH_USER']!=$oi->settings['stats_user'] OR $_SERVER['PHP_AUTH_PW']!=$oi->settings['stats_password'])
21
+ {
22
+ header('HTTP/1.0 401 Unauthorized');
23
+ echo 'Wrong username/password';
24
+ exit;
25
+ }
26
+ }
27
+
28
+ if (isset($_GET['op']))
29
+ if ($_GET['op']=='reset')
30
+ {
31
+ $oi->statsQuery("DELETE FROM oi_imports");
32
+ $oi->statsQuery("DELETE FROM oi_messages");
33
+ }
34
+
35
+ $plugins=$oi->getPlugins();
36
+ $import_stats=array();$messages_stats=array();
37
+ $res=$oi->statsQuery("SELECT COUNT(id) AS total_imports,SUM(contacts) AS total_contacts,service FROM oi_imports GROUP BY service ORDER BY total_imports DESC,total_contacts DESC");
38
+ while ($row=sqlite_fetch_array($res)) $import_stats[$row['service']]=$row;
39
+ $res=$oi->statsQuery("SELECT COUNT(id) AS total_sends,SUM(messages) AS total_messages,service FROM oi_messages GROUP BY service");
40
+ while ($row=sqlite_fetch_array($res)) $messages_stats[$row['service']]=$row;
41
+ echo "<style>
42
+ .tableDesc{ color:#3d3d3d;font-family:Arial, Helvetica, sans-serif;font-weight:normal;font-size:12px;text-decoration:none; }
43
+ .tableDesc td{ text-align:center; }
44
+ .table{ border:1px solid #e1e1e1;padding:1px 1px 1px 1px;font-family:Arial, Helvetica, sans-serif;font-weight:normal;font-size:11px; }
45
+ .table td { padding:5px; }
46
+ .tableFooter{ height:30px;text-align:center;font-family:Arial, Helvetica, sans-serif;font-size:14px;color:#000000;font-weight:600;background-color:#C7DEE6; }
47
+ .tableFooter td{ text-align:center; }
48
+ .tableHeader{ background-color:#5fb52b;height:21px;font-family:Arial, Helvetica, sans-serif;font-size:12px;color:#FFFFFF;font-weight:bold;text-decoration:none;text-align:left;vertical-align:middle;padding-left:10px; }
49
+ .tableHeader td{ text-align:center; }
50
+ .tableOddRow{ background-color:#eaeaea;height:32px; }
51
+ .tableEvenRow{ background-color:#f5f5f5;height:32px; }
52
+ .title{ color:#89BDF6; }
53
+ body{ background-color:#F4F3EF; }
54
+ a{ color:#FF7E00;font-family:Arial, Helvetica, sans-serif;font-weight:bold;font-size:14px; }
55
+ </style>";
56
+ echo "<center><h1 class='title'>OpenInviter Stats</h1></center>";
57
+ echo "<table class='table' align='center' cellspacing='0' cellpadding='0' width='500'>
58
+ <tr class='tableHeader'><td colspan='5'>OpenInviter Statistics</td></tr>";
59
+ if (!empty($import_stats))
60
+ {
61
+ echo "<tr class='tableDesc'><td>Service</td><td>Users who imported contacts</td><td>Contacts imported</td><td>Users who sent messages</td><td>Messages sent</td></tr>";
62
+ $total_imports=0;$total_contacts=0;$total_sends=0;$total_messages=0;$odd=true;
63
+ foreach ($import_stats as $service=>$details)
64
+ {
65
+ $total_imports+=$details['total_imports'];
66
+ $total_contacts+=$details['total_contacts'];
67
+ echo "<tr class='".($odd?'tableOddRow':'tableEvenRow')."'><td><b>".(isset($plugins['email'][$service])?$plugins['email'][$service]['name']:(isset($plugins['social'][$service])?$plugins['social'][$service]['name']:$service))."</b></td><td align='center'>{$details['total_imports']}</td><td align='center'>{$details['total_contacts']}</td>";
68
+ if (isset($messages_stats[$service]))
69
+ {
70
+ $total_sends+=$messages_stats[$service]['total_sends'];
71
+ $total_messages+=$messages_stats[$service]['total_messages'];
72
+ echo "<td align='center'>{$messages_stats[$service]['total_sends']}</td><td align='center'>{$messages_stats[$service]['total_messages']}</td>";
73
+ }
74
+ else echo "<td align='center'>-</td><td align='center'>-</td>";
75
+ echo "</tr>";
76
+ $odd=!$odd;
77
+ }
78
+ echo "<tr class='tableFooter'><td>Total</td><td>{$total_imports}</td><td>{$total_contacts}</td><td>{$total_sends}</td><td>{$total_messages}</td></tr>
79
+ </table>
80
+ <br><center><a href='?op=reset'>Reset statistics</a></center>";
81
+ }
82
+ else
83
+ echo "<tr class='tableOddRow'><td colspan='5' style='padding:25px;' align='center'>There are no statistics available yet</td></tr></table>";
84
+ echo "<br><center><a target='_blank' href='http://openinviter.com' title='Powered by OpenInviter.com'><img src='http://openinviter.com/images/banners/banner_blue_1.gif' alt='Powered by OpenInviter.com' style='border:none;'></a></center>";
85
+ ?>
app/code/community/Auguria/Sponsorship/Model/Adminhtml/System/Config/Backend/Sponsorship/Openinviter.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Auguria
4
+ * @package Auguria_Sponsorship
5
+ * @author Auguria
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Auguria_Sponsorship_Model_Adminhtml_System_Config_Backend_Sponsorship_Openinviter extends Mage_Core_Model_Config_Data
9
+ {
10
+ protected function _afterSave()
11
+ {
12
+ $data = $this->getData();
13
+ $username = $data['groups']['open_inviter']['fields']['username']['value'];
14
+ $private_key = $data['groups']['open_inviter']['fields']['private_key']['value'];
15
+ $configFilePath = Mage::getModuleDir('', 'Auguria_Sponsorship').'/Lib/OpenInviter/config.php';
16
+ $configFile = fopen($configFilePath, 'w');
17
+ $stringData =
18
+ '<?php
19
+
20
+ $openinviter_settings=array(
21
+ "username"=>"'.$username.'",
22
+ "private_key"=>"'.$private_key.'",
23
+ "cookie_path"=>"/tmp",
24
+ "transport"=>"curl",
25
+ "local_debug"=>"on_error",
26
+ "remote_debug"=>"",
27
+ "hosted"=>"",
28
+ "proxies"=>array(),
29
+ "stats"=>"",
30
+ "plugins_cache_time"=>"1800",
31
+ "plugins_cache_file"=>"oi_plugins.php",
32
+ "update_files"=>"0",
33
+ "stats_user"=>"",
34
+ "stats_password"=>"");
35
+ ?>';
36
+ fwrite($configFile, $stringData);
37
+ fclose($configFile);
38
+ return $this;
39
+ }
40
+ }
app/code/community/Auguria/Sponsorship/Model/EmptyPHP.php DELETED
@@ -1,266 +0,0 @@
1
- <?php
2
- class test
3
- {
4
- public function process(Mage_Sales_Model_Quote_Item_Abstract $item)
5
- {
6
- $item->setFreeShipping(false);
7
- $item->setDiscountAmount(0);
8
- $item->setBaseDiscountAmount(0);
9
- $item->setDiscountPercent(0);
10
- $item->setCartFidelityPoints(0);
11
- $item->setCartSponsorPoints(0);
12
-
13
- $quote = $item->getQuote();
14
- if ($item instanceof Mage_Sales_Model_Quote_Address_Item) {
15
- $address = $item->getAddress();
16
- } elseif ($quote->isVirtual()) {
17
- $address = $quote->getBillingAddress();
18
- } else {
19
- $address = $quote->getShippingAddress();
20
- }
21
-
22
- $customerId = $quote->getCustomerId();
23
- $ruleCustomer = Mage::getModel('salesrule/rule_customer');
24
- $appliedRuleIds = array();
25
-
26
- foreach ($this->_rules as $rule) {
27
- /* @var $rule Mage_SalesRule_Model_Rule */
28
- /**
29
- * already tried to validate and failed
30
- */
31
- if ($rule->getIsValid() === false) {
32
- continue;
33
- }
34
-
35
- if ($rule->getIsValid() !== true) {
36
- /**
37
- * too many times used in general
38
- */
39
- if ($rule->getUsesPerCoupon() && ($rule->getTimesUsed() >= $rule->getUsesPerCoupon())) {
40
- $rule->setIsValid(false);
41
- continue;
42
- }
43
- /**
44
- * too many times used for this customer
45
- */
46
- $ruleId = $rule->getId();
47
- if ($ruleId && $rule->getUsesPerCustomer()) {
48
- $ruleCustomer->loadByCustomerRule($customerId, $ruleId);
49
- if ($ruleCustomer->getId()) {
50
- if ($ruleCustomer->getTimesUsed() >= $rule->getUsesPerCustomer()) {
51
- continue;
52
- }
53
- }
54
- }
55
- $rule->afterLoad();
56
- /**
57
- * quote does not meet rule's conditions
58
- */
59
- if (!$rule->validate($address)) {
60
- $rule->setIsValid(false);
61
- continue;
62
- }
63
- /**
64
- * passed all validations, remember to be valid
65
- */
66
- $rule->setIsValid(true);
67
- }
68
-
69
- /**
70
- * although the rule is valid, this item is not marked for action
71
- */
72
- if (!$rule->getActions()->validate($item)) {
73
- continue;
74
- }
75
- $qty = $item->getQty();
76
- if ($item->getParentItem()) {
77
- $qty*= $item->getParentItem()->getQty();
78
- }
79
- $qty = $rule->getDiscountQty() ? min($qty, $rule->getDiscountQty()) : $qty;
80
- $rulePercent = min(100, $rule->getDiscountAmount());
81
- $discountAmount = 0;
82
- $baseDiscountAmount = 0;
83
- $cartFidelityPoints = 0;
84
- $cartSponsorPoints = 0;
85
- switch ($rule->getSimpleAction()) {
86
- case 'to_percent':
87
- $rulePercent = max(0, 100-$rule->getDiscountAmount());
88
- //no break;
89
-
90
- case 'by_percent':
91
- if ($step = $rule->getDiscountStep()) {
92
- $qty = floor($qty/$step)*$step;
93
- }
94
- $discountAmount = ($qty*$item->getCalculationPrice() - $item->getDiscountAmount()) * $rulePercent/100;
95
- $baseDiscountAmount= ($qty*$item->getBaseCalculationPrice() - $item->getBaseDiscountAmount()) * $rulePercent/100;
96
-
97
- if (!$rule->getDiscountQty() || $rule->getDiscountQty()>$qty) {
98
- $discountPercent = min(100, $item->getDiscountPercent()+$rulePercent);
99
- $item->setDiscountPercent($discountPercent);
100
- }
101
- break;
102
-
103
- case 'to_fixed':
104
- $quoteAmount = $quote->getStore()->convertPrice($rule->getDiscountAmount());
105
- $discountAmount = $qty*($item->getCalculationPrice()-$quoteAmount);
106
- $baseDiscountAmount= $qty*($item->getBaseCalculationPrice()-$rule->getDiscountAmount());
107
- break;
108
-
109
- case 'by_fixed':
110
- if ($step = $rule->getDiscountStep()) {
111
- $qty = floor($qty/$step)*$step;
112
- }
113
- $quoteAmount = $quote->getStore()->convertPrice($rule->getDiscountAmount());
114
- $discountAmount = $qty*$quoteAmount;
115
- $baseDiscountAmount= $qty*$rule->getDiscountAmount();
116
- break;
117
-
118
- case 'cart_fixed':
119
- $cartRules = $address->getCartFixedRules();
120
- if (!isset($cartRules[$rule->getId()])) {
121
- $cartRules[$rule->getId()] = $rule->getDiscountAmount();
122
- }
123
- if ($cartRules[$rule->getId()] > 0) {
124
- $quoteAmount = $quote->getStore()->convertPrice($cartRules[$rule->getId()]);
125
- $discountAmount = min($item->getRowTotal(), $quoteAmount);
126
- $baseDiscountAmount = min($item->getBaseRowTotal(), $cartRules[$rule->getId()]);
127
- $cartRules[$rule->getId()] -= $baseDiscountAmount;
128
- }
129
- $address->setCartFixedRules($cartRules);
130
- break;
131
-
132
- case 'buy_x_get_y':
133
- $x = $rule->getDiscountStep();
134
- $y = $rule->getDiscountAmount();
135
- if (!$x || $y>=$x) {
136
- break;
137
- }
138
- $buy = 0; $free = 0;
139
- while ($buy+$free<$qty) {
140
- $buy += $x;
141
- if ($buy+$free>=$qty) {
142
- break;
143
- }
144
- $free += min($y, $qty-$buy-$free);
145
- if ($buy+$free>=$qty) {
146
- break;
147
- }
148
- }
149
- $discountAmount = $free*$item->getCalculationPrice();
150
- $baseDiscountAmount= $free*$item->getBaseCalculationPrice();
151
- break;
152
-
153
- //début case perso-------------------------------------------------------------------
154
- //fielity
155
- case 'fidelity_points_by_fixed':
156
- if ($step = $rule->getDiscountStep()) {
157
- $qty = floor($qty/$step)*$step;
158
- }
159
- $cartFidelityPoints = $qty*$rule->getDiscountAmount();
160
- break;
161
-
162
- case 'fidelity_points_by_percent':
163
- if ($step = $rule->getDiscountStep()) {
164
- $qty = floor($qty/$step)*$step;
165
- }
166
- $cartFidelityPoints = ($qty * ($item->getBaseCalculationPrice() - $item->getBaseDiscountAmount())) * $rulePercent/100;
167
- break;
168
-
169
- case 'fidelity_points_cart_fixed':
170
- $cartRules = $address->getCartFixedRules();
171
- if (!isset($cartRules[$rule->getId()])) {
172
- $cartRules[$rule->getId()] = $rule->getDiscountAmount();
173
- }
174
- if ($cartRules[$rule->getId()] > 0) {
175
- $cartFidelityPoints = max($item->getCartFidelityPoints(), $cartRules[$rule->getId()]);
176
- $cartRules[$rule->getId()] -= $cartFidelityPoints;
177
- }
178
- $address->setCartFixedRules($cartRules);
179
- break;
180
- //sponsor
181
- case 'sponsor_points_by_fixed':
182
- if ($step = $rule->getDiscountStep()) {
183
- $qty = floor($qty/$step)*$step;
184
- }
185
- $cartSponsorPoints = $qty*$rule->getDiscountAmount();
186
- break;
187
-
188
- case 'sponsor_points_by_percent':
189
- if ($step = $rule->getDiscountStep()) {
190
- $qty = floor($qty/$step)*$step;
191
- }
192
- $cartSponsorPoints = ($qty * ($item->getBaseCalculationPrice() - $item->getBaseDiscountAmount())) * $rulePercent/100;
193
- break;
194
-
195
- case 'sponsor_points_cart_fixed':
196
- $cartRules = $address->getCartFixedRules();
197
- if (!isset($cartRules[$rule->getId()])) {
198
- $cartRules[$rule->getId()] = $rule->getDiscountAmount();
199
- }
200
- if ($cartRules[$rule->getId()] > 0) {
201
- $cartSponsorPoints = max($item->getCartFidelityPoints(), $cartRules[$rule->getId()]);
202
- $cartRules[$rule->getId()] -= $cartSponsorPoints;
203
- }
204
- $address->setCartFixedRules($cartRules);
205
- break;
206
- //fin case perso-------------------------------------------------------------------
207
- }
208
-
209
- $result = new Varien_Object(array(
210
- 'discount_amount' => $discountAmount,
211
- 'base_discount_amount' => $baseDiscountAmount,
212
- 'cart_fidelity_points' => $cartFidelityPoints,
213
- 'cart_sponsor_points' => $cartSponsorPoints,
214
- ));
215
- Mage::dispatchEvent('salesrule_validator_process', array(
216
- 'rule' => $rule,
217
- 'item' => $item,
218
- 'address' => $address,
219
- 'quote' => $quote,
220
- 'qty' => $qty,
221
- 'result' => $result,
222
- ));
223
-
224
- $discountAmount = $quote->getStore()->roundPrice($discountAmount);
225
- $baseDiscountAmount = $quote->getStore()->roundPrice($baseDiscountAmount);
226
- $discountAmount = min($item->getDiscountAmount()+$discountAmount, $item->getRowTotal());
227
- $baseDiscountAmount = min($item->getBaseDiscountAmount()+$baseDiscountAmount, $item->getBaseRowTotal());
228
-
229
- //On garde uniquement la règle qui apporte leplus de points
230
- $cartFidelityPoints = max($item->getCartFidelityPoints(), $cartFidelityPoints);
231
- $cartSponsorPoints = max($item->getCartSponsorPoints(), $cartSponsorPoints);
232
-
233
- $item->setDiscountAmount($discountAmount);
234
- $item->setBaseDiscountAmount($baseDiscountAmount);
235
-
236
- $item->setCartFidelityPoints($cartFidelityPoints);
237
- $item->setCartSponsorPoints($cartSponsorPoints);
238
-
239
- switch ($rule->getSimpleFreeShipping()) {
240
- case Mage_SalesRule_Model_Rule::FREE_SHIPPING_ITEM:
241
- $item->setFreeShipping($rule->getDiscountQty() ? $rule->getDiscountQty() : true);
242
- break;
243
-
244
- case Mage_SalesRule_Model_Rule::FREE_SHIPPING_ADDRESS:
245
- $address->setFreeShipping(true);
246
- break;
247
- }
248
-
249
- $appliedRuleIds[$rule->getRuleId()] = $rule->getRuleId();
250
-
251
- if ($rule->getCouponCode() && ( strtolower($rule->getCouponCode()) == strtolower($this->getCouponCode()))) {
252
- $address->setCouponCode($this->getCouponCode());
253
- }
254
-
255
- if ($rule->getStopRulesProcessing()) {
256
- break;
257
- }
258
- }
259
-
260
- $item->setAppliedRuleIds(join(',',$appliedRuleIds));
261
- $address->setAppliedRuleIds($this->mergeIds($address->getAppliedRuleIds(), $appliedRuleIds));
262
- $quote->setAppliedRuleIds($this->mergeIds($quote->getAppliedRuleIds(), $appliedRuleIds));
263
- return $this;
264
- }
265
- }
266
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Auguria/Sponsorship/Model/Observer.php CHANGED
@@ -331,4 +331,37 @@ class Auguria_Sponsorship_Model_Observer
331
  }
332
 
333
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  }
331
  }
332
 
333
  }
334
+
335
+ public function affiliate($observer)
336
+ {
337
+ $controller = $observer['controller_action'];
338
+ /*
339
+ * Transmission de l'id du parrain + nom + prenom dans l'url
340
+ * http://www.inkonso.com?sponsor_id=x&nom=xxx&prenom=xxx&email=xxx
341
+ */
342
+ $sponsorId = $controller->getRequest()->getParam('sponsor_id');
343
+ if ($sponsorId!='')
344
+ {
345
+ $nom = $controller->getRequest()->getParam('nom');
346
+ $prenom = $controller->getRequest()->getParam('prenom');
347
+ $email = $controller->getRequest()->getParam('email');
348
+
349
+ //stockage des variables dans la session
350
+ $session = Mage::getSingleton('core/session');
351
+ $session->setData('sponsor_id',$sponsorId);
352
+ $session->setData('firstname',$prenom);
353
+ $session->setData('lastname',$nom);
354
+ $session->setData('email',$email);
355
+
356
+ //stockage de l'id du parrain dans un cookie
357
+ $sponsorInvitationValidity = Mage::getStoreConfig('sponsorship/sponsor/sponsor_invitation_validity');
358
+ $period =3600*24*$sponsorInvitationValidity;
359
+
360
+ $cookie = new Mage_Core_Model_Cookie;
361
+ $cookie->set('sponsorship_id', $sponsorId, $period);
362
+ $cookie->set('sponsorship_firstname', $prenom, $period);
363
+ $cookie->set('sponsorship_lastname', $nom, $period);
364
+ $cookie->set('sponsorship_email', $email, $period);
365
+ }
366
+ }
367
  }
app/code/community/Auguria/Sponsorship/Model/Openinviter.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Auguria
4
+ * @package Auguria_Sponsorship
5
+ * @author Auguria
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ require_once (Mage::getModuleDir('', 'Auguria_Sponsorship').'/Lib/OpenInviter/openinviter.php');
9
+ class Auguria_Sponsorship_Model_Openinviter
10
+ {
11
+ public $inviter;
12
+
13
+ public function __construct()
14
+ {
15
+ $this->inviter = new OpenInviter();
16
+ }
17
+
18
+ public function getOpenIniviterPlugins()
19
+ {
20
+ return $this->inviter->getPlugins();
21
+ }
22
+
23
+ public function getOpenInviterTypes()
24
+ {
25
+ return $this->inviter->pluginTypes;
26
+ }
27
+
28
+ public function startPlugin($provider_box, $getPlugins=false)
29
+ {
30
+ return $this->inviter->startPlugin($provider_box, $getPlugins);
31
+ }
32
+
33
+ public function getInternalError()
34
+ {
35
+ return $this->inviter->getInternalError();
36
+ }
37
+
38
+ public function getSessionID()
39
+ {
40
+ return $this->inviter->plugin->getSessionID();
41
+ }
42
+
43
+ public function getMyContacts()
44
+ {
45
+ return $this->inviter->getMyContacts();
46
+ }
47
+
48
+ public function login($email_box ,$password_box)
49
+ {
50
+ return $this->inviter->login($email_box, $password_box);
51
+ }
52
+ }
app/code/community/Auguria/Sponsorship/controllers/IndexController.php CHANGED
@@ -45,9 +45,11 @@ class Auguria_Sponsorship_IndexController extends Mage_Core_Controller_Front_Act
45
  }
46
  }
47
 
48
- public function postAction()
49
  {
50
- $post = $this->getRequest()->getPost();
 
 
51
  if ( $post )
52
  {
53
  $translate = Mage::getSingleton('core/translate');
@@ -57,7 +59,7 @@ class Auguria_Sponsorship_IndexController extends Mage_Core_Controller_Front_Act
57
  $validation = $mail->validateMail($mails);
58
  $checksend = false;
59
  $checksave = false;
60
- if ($validation == true)
61
  {
62
  foreach ($mails as $email)
63
  {
@@ -73,6 +75,10 @@ class Auguria_Sponsorship_IndexController extends Mage_Core_Controller_Front_Act
73
  if ($checksend == false)
74
  {
75
  Mage::getSingleton('customer/session')->addSuccess(Mage::helper('sponsorship')->__("Your email has been successfully sent."));
 
 
 
 
76
  $checksend = true;
77
  }
78
  if (!$mail->saveMail($email))
@@ -96,7 +102,7 @@ class Auguria_Sponsorship_IndexController extends Mage_Core_Controller_Front_Act
96
  Mage::getSingleton('customer/session')->addError($this->__("Please check the form fields."));
97
  $this->_redirect("*/*/");
98
  }
99
- $translate->setTranslateInline(true);
100
  $this->_redirect("*/*/");
101
  }
102
  else
45
  }
46
  }
47
 
48
+ public function sendAction()
49
  {
50
+ $post = $this->getRequest()->getPost();
51
+ $session = Mage::getSingleton('customer/session');
52
+ $session->setData('sponsorship_form', $post);
53
  if ( $post )
54
  {
55
  $translate = Mage::getSingleton('core/translate');
59
  $validation = $mail->validateMail($mails);
60
  $checksend = false;
61
  $checksave = false;
62
+ if ($validation == true && isset($post['recipient']))
63
  {
64
  foreach ($mails as $email)
65
  {
75
  if ($checksend == false)
76
  {
77
  Mage::getSingleton('customer/session')->addSuccess(Mage::helper('sponsorship')->__("Your email has been successfully sent."));
78
+ //remove recipient from session
79
+ $form = Mage::getSingleton('customer/session')->getData('sponsorship_form');
80
+ $form['recipient']=array();
81
+ $session->setData('sponsorship_form', $form);
82
  $checksend = true;
83
  }
84
  if (!$mail->saveMail($email))
102
  Mage::getSingleton('customer/session')->addError($this->__("Please check the form fields."));
103
  $this->_redirect("*/*/");
104
  }
105
+ $translate->setTranslateInline(true);
106
  $this->_redirect("*/*/");
107
  }
108
  else
app/code/community/Auguria/Sponsorship/controllers/OpeninviterController.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Auguria
4
+ * @package Auguria_Sponsorship
5
+ * @author Auguria
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Auguria_Sponsorship_OpeninviterController extends Mage_Core_Controller_Front_Action
9
+ {
10
+ public function preDispatch()
11
+ {
12
+ parent::preDispatch();
13
+ //verification que le module de parrainage est activé
14
+ if( !Mage::getStoreConfig('sponsorship/sponsor/sponsor_enabled')) {
15
+ $this->_redirect('');
16
+ }
17
+ //verification que l'utilisateur est logué
18
+ elseif (!Mage::getSingleton('customer/session')->isLoggedIn()) {
19
+ $this->_redirectUrl(Mage::helper('customer')->getAccountUrl());
20
+ }
21
+ //verification que l'envoie de mail est autorisé sans commande
22
+ elseif (!Mage::getStoreConfig('sponsorship/sponsor/sponsor_optional_order') &&
23
+ !Mage::helper('sponsorship/data')->haveOrder()) {
24
+ //vérification qu'une commande a été passée
25
+ if (!Mage::helper('sponsorship/data')->haveOrder()) {
26
+ $this->_redirecturl(Mage::helper('customer')->getAccountUrl());
27
+ }
28
+ }
29
+ }
30
+
31
+ public function indexAction()
32
+ {
33
+ $inviter = Mage::getModel('sponsorship/openinviter');
34
+ $session = Mage::getSingleton('customer/session');
35
+ $old_form = Mage::getSingleton('customer/session')->getData('openinviter_form');
36
+ if (!isset($old_form))
37
+ $old_form = array();
38
+
39
+ $new_form = array (
40
+ 'plugins'=>$inviter->getOpenIniviterPlugins(),
41
+ 'types'=>$inviter->getOpenInviterTypes(),
42
+ 'step'=>'get_contacts'
43
+ );
44
+ $form = array_merge($old_form, $new_form);
45
+ $session->setData('openinviter_form', $form);
46
+
47
+ $this->loadLayout();
48
+ $this->getLayout()->getBlock('sponsorship/openinviter');
49
+ $this->_initLayoutMessages('customer/session');
50
+ $this->_initLayoutMessages('catalog/session');
51
+ $this->renderLayout();
52
+
53
+ //Ajout d'un message d'erreur si l'envoie de mail n'est pas autorisé sans commande et que le client n'a pas commandé
54
+ if (!Mage::getStoreConfig('sponsorship/sponsor/sponsor_optional_order')) {
55
+ if (!Mage::helper('sponsorship/data')->haveOrder()) {
56
+ Mage::getSingleton('customer/session')->addError(Mage::helper('sponsorship')->__('You must already have purchased to sponsor.'));
57
+ }
58
+ }
59
+ }
60
+
61
+ public function importAction()
62
+ {
63
+ try
64
+ {
65
+ $post = $this->getRequest()->getPost();
66
+ $session = Mage::getSingleton('customer/session');
67
+ $session->setData('openinviter_form', $post);
68
+ if ( $post )
69
+ {
70
+ if (empty($post['email_box']))
71
+ Mage::getSingleton('customer/session')->addError(Mage::helper('sponsorship')->__("Email missing !"));
72
+ if (empty($post['password_box']))
73
+ Mage::getSingleton('customer/session')->addError(Mage::helper('sponsorship')->__("Password missing !"));
74
+ if (empty($post['provider_box']))
75
+ Mage::getSingleton('customer/session')->addError(Mage::helper('sponsorship')->__("Provider missing !"));
76
+
77
+ $messages = Mage::getSingleton('customer/session')->getMessages();
78
+ $errors = $messages->getErrors();
79
+ $form['step']= 'get_contacts';
80
+ if (!count($errors))
81
+ {
82
+ $inviter = Mage::getModel('sponsorship/openinviter');
83
+ $inviter->getOpenIniviterPlugins();
84
+ include_once (Mage::getModuleDir('', 'Auguria_Sponsorship').'/Lib/OpenInviter/plugins/'.$post['provider_box'].'.plg.php');
85
+ $result = $inviter->startPlugin($post['provider_box']);
86
+ $contacts;
87
+
88
+ $internal = $inviter->getInternalError();
89
+ if ($internal)
90
+ Mage::getSingleton('customer/session')->addError(Mage::helper('sponsorship')->__($internal));
91
+
92
+ elseif (!$inviter->login($post['email_box'],$post['password_box']))
93
+ {
94
+ $internal=$inviter->getInternalError();
95
+ $message = ($internal ? $internal : "Login failed. Please check the email and password you have provided and try again later !");
96
+ Mage::getSingleton('customer/session')->addError(Mage::helper('sponsorship')->__($message));
97
+ }
98
+ elseif (false===$contacts=$inviter->getMyContacts())
99
+ {
100
+ Mage::getSingleton('customer/session')->addError(Mage::helper('sponsorship')->__("Unable to get contacts !"));
101
+ }
102
+ else
103
+ {
104
+ $new_form = array (
105
+ 'step'=>'send_invites',
106
+ 'oi_session_id'=>$inviter->getSessionID(),
107
+ 'contacts'=>$contacts
108
+ );
109
+ $form = array_merge($post, $new_form);
110
+ $session->setData('openinviter_form', $form);
111
+ }
112
+ }
113
+ if ($form['step']=='send_invites')
114
+ {
115
+ $this->loadLayout();
116
+ $this->getLayout()->getBlock('sponsorship/openinviter');
117
+ $this->_initLayoutMessages('customer/session');
118
+ $this->_initLayoutMessages('catalog/session');
119
+ $this->renderLayout();
120
+ }
121
+ else
122
+ $this->_redirect("*/*/");
123
+ }
124
+ else
125
+ {
126
+ $this->_redirect("*/*/");
127
+ }
128
+ }
129
+ catch (Exception $e)
130
+ {
131
+ Mage::getSingleton('customer/session')->addError(Mage::helper('sponsorship')->__("An exception occured !"));
132
+ $this->_redirect("*/*/");
133
+ }
134
+ }
135
+
136
+ }
app/code/community/Auguria/Sponsorship/controllers/SponsorController.php CHANGED
@@ -15,35 +15,9 @@ class Auguria_Sponsorship_SponsorController extends Mage_Core_Controller_Front_A
15
  public function indexAction()
16
  {
17
  /*
18
- * Transmission de l'id du parrain + nom + prenom dans l'url
19
- * http://www.inkonso.com/index.php/sponsorship/sponsor_id/xxx/nom/xxx/prenom/xxx
20
  */
21
- $sponsorId = $this->getRequest()->getParam('sponsor_id');
22
- if ($sponsorId!='')
23
- {
24
- $nom = $this->getRequest()->getParam('nom');
25
- $prenom = $this->getRequest()->getParam('prenom');
26
- $email = $this->getRequest()->getParam('email');
27
-
28
- //stockage des variables dans la session
29
- $session = Mage::getSingleton('core/session');
30
- $session->setData('sponsor_id',$sponsorId);
31
- $session->setData('firstname',$prenom);
32
- $session->setData('lastname',$nom);
33
- $session->setData('email',$email);
34
-
35
- //stockage de l'id du parrain dans un cookie
36
-
37
- $sponsorInvitationValidity = Mage::getStoreConfig('sponsorship/sponsor/sponsor_invitation_validity');
38
- $period =3600*24*$sponsorInvitationValidity;
39
-
40
- $cookie = new Mage_Core_Model_Cookie;
41
- $cookie->set('sponsorship_id', $sponsorId, $period);
42
- $cookie->set('sponsorship_firstname', $prenom, $period);
43
- $cookie->set('sponsorship_lastname', $nom, $period);
44
- $cookie->set('sponsorship_email', $email, $period);
45
- }
46
- //redirection vers la page d'accueil
47
  $this->_redirect('');
48
  }
49
  }
15
  public function indexAction()
16
  {
17
  /*
18
+ * Cette page est obsolète, elle est gardée par souci de compatibilité avec l'affiliation
19
+ * Le code est dorénavent déclanché dans affiliate() de Auguria_Sponsorship_Model_Observer
20
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  $this->_redirect('');
22
  }
23
  }
app/code/community/Auguria/Sponsorship/etc/config.xml CHANGED
@@ -10,7 +10,7 @@
10
  <config>
11
  <modules>
12
  <Auguria_Sponsorship>
13
- <version>1.0.2</version>
14
  </Auguria_Sponsorship>
15
  </modules>
16
  <frontend>
@@ -18,6 +18,7 @@
18
  <sponsorship_index>/sponsorship/index/</sponsorship_index>
19
  <sponsorship_boost>/sponsorship/boost/</sponsorship_boost>
20
  <sponsorship_points>/sponsorship/points/</sponsorship_points>
 
21
  </secure_url>
22
  <routers>
23
  <sponsorship>
@@ -145,8 +146,17 @@
145
  <method>setSponsor</method>
146
  </set_sponsorship>
147
  </observers>
148
- </checkout_type_onepage_save_order_after>
149
-
 
 
 
 
 
 
 
 
 
150
  <!-- Incrémentation des points lors du paiement -->
151
  <sales_order_payment_pay>
152
  <observers>
@@ -319,6 +329,11 @@
319
  <change>
320
  <email_template_coupon>sponsorship_email_coupon</email_template_coupon>
321
  </change>
 
 
 
 
 
322
  </sponsorship>
323
  </default>
324
  <crontab>
10
  <config>
11
  <modules>
12
  <Auguria_Sponsorship>
13
+ <version>1.0.3</version>
14
  </Auguria_Sponsorship>
15
  </modules>
16
  <frontend>
18
  <sponsorship_index>/sponsorship/index/</sponsorship_index>
19
  <sponsorship_boost>/sponsorship/boost/</sponsorship_boost>
20
  <sponsorship_points>/sponsorship/points/</sponsorship_points>
21
+ <sponsorship_openinviter>/sponsorship/openinviter/</sponsorship_openinviter>
22
  </secure_url>
23
  <routers>
24
  <sponsorship>
146
  <method>setSponsor</method>
147
  </set_sponsorship>
148
  </observers>
149
+ </checkout_type_onepage_save_order_after>
150
+ <!-- Affiliation sur toutes les pages -->
151
+ <controller_action_predispatch>
152
+ <observers>
153
+ <affiliate>
154
+ <type>singleton</type>
155
+ <class>Auguria_Sponsorship_Model_Observer</class>
156
+ <method>affiliate</method>
157
+ </affiliate>
158
+ </observers>
159
+ </controller_action_predispatch>
160
  <!-- Incrémentation des points lors du paiement -->
161
  <sales_order_payment_pay>
162
  <observers>
329
  <change>
330
  <email_template_coupon>sponsorship_email_coupon</email_template_coupon>
331
  </change>
332
+ <open_inviter>
333
+ <open_inviter_enabled>0</open_inviter_enabled>
334
+ <username></username>
335
+ <private_key></private_key>
336
+ </open_inviter>
337
  </sponsorship>
338
  </default>
339
  <crontab>
app/code/community/Auguria/Sponsorship/etc/system.xml CHANGED
@@ -266,6 +266,43 @@
266
  </email_template_coupon>
267
  </fields>
268
  </change>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  </groups>
270
  </sponsorship>
271
  </sections>
266
  </email_template_coupon>
267
  </fields>
268
  </change>
269
+ <open_inviter translate="label">
270
+ <label>Open Inviter options</label>
271
+ <comment><![CDATA[Allows customers to import addressbook/contacts from different email providers like Yahoo, Gmail, Hotmail, Live etc. using different CMS software like Drupal, Joomla etc. or forum software like PHPBB, SMF etc. Learn more on <a href='http://openinviter.com'>openinviter.com</a>]]></comment>
272
+ OpenInviter - import addressbook/contacts from different email providers like Yahoo, Gmail, Hotmail, Live etc. using different CMS software like Drupal, Joomla etc. or forum software like PHPBB, SMF etc. available at <a href='openinviter.com'>http://openinviter.com</a>
273
+ <sort_order>5</sort_order>
274
+ <show_in_default>1</show_in_default>
275
+ <show_in_website>1</show_in_website>
276
+ <show_in_store>1</show_in_store>
277
+ <fields>
278
+ <open_inviter_enabled>
279
+ <label>Activated</label>
280
+ <frontend_type>select</frontend_type>
281
+ <source_model>adminhtml/system_config_source_yesno</source_model>
282
+ <sort_order>1</sort_order>
283
+ <show_in_default>1</show_in_default>
284
+ <show_in_website>1</show_in_website>
285
+ <show_in_store>1</show_in_store>
286
+ </open_inviter_enabled>
287
+ <username>
288
+ <label>Username</label>
289
+ <frontend_type>text</frontend_type>
290
+ <backend_model>sponsorship/adminhtml_system_config_backend_sponsorship_openinviter</backend_model>
291
+ <sort_order>2</sort_order>
292
+ <show_in_default>1</show_in_default>
293
+ <show_in_website>1</show_in_website>
294
+ <show_in_store>1</show_in_store>
295
+ </username>
296
+ <private_key>
297
+ <label>Private Kay</label>
298
+ <frontend_type>text</frontend_type>
299
+ <sort_order>3</sort_order>
300
+ <show_in_default>1</show_in_default>
301
+ <show_in_website>1</show_in_website>
302
+ <show_in_store>1</show_in_store>
303
+ </private_key>
304
+ </fields>
305
+ </open_inviter>
306
  </groups>
307
  </sponsorship>
308
  </sections>
app/design/frontend/default/default/layout/sponsorship.xml CHANGED
@@ -16,6 +16,24 @@
16
  </reference>
17
  </sponsorship_index_index>
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  <!-- Déclaration du block détail des points fidélité -->
20
  <sponsorship_fidelitypoints_index>
21
  <update handle="customer_account"/>
16
  </reference>
17
  </sponsorship_index_index>
18
 
19
+ <!-- Déclaration du template OpenInviter -->
20
+ <sponsorship_openinviter_index>
21
+ <reference name="root">
22
+ <action method="setTemplate"><template>page/empty.phtml</template></action>
23
+ </reference>
24
+ <reference name="content">
25
+ <block type="sponsorship/openinviter" name="openinviter" template="sponsorship/openinviter.phtml" />
26
+ </reference>
27
+ </sponsorship_openinviter_index>
28
+ <sponsorship_openinviter_import>
29
+ <reference name="root">
30
+ <action method="setTemplate"><template>page/empty.phtml</template></action>
31
+ </reference>
32
+ <reference name="content">
33
+ <block type="sponsorship/openinviter" name="openinviter" template="sponsorship/openinviterimport.phtml" />
34
+ </reference>
35
+ </sponsorship_openinviter_import>
36
+
37
  <!-- Déclaration du block détail des points fidélité -->
38
  <sponsorship_fidelitypoints_index>
39
  <update handle="customer_account"/>
app/design/frontend/default/default/template/sponsorship/openinviter.phtml ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ /**
3
+ * @category Auguria
4
+ * @package Auguria_Sponsorship
5
+ * @author Auguria
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ -->
9
+ <?php
10
+ if (Mage::getStoreConfig('sponsorship/open_inviter/open_inviter_enabled')==true):
11
+ ?>
12
+ <div id="messages_openinviter"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
13
+ <form action="<?php echo $this->getUrl('sponsorship/openinviter/import') ?>" id="openinviter" method="post">
14
+ <div class="fieldset open_inviter_options">
15
+ <h2 class="legend"><?php echo $this->__('Select your provider and sign in:') ?></h2>
16
+ <?php
17
+ $step = $this->getOpenInviterStep();
18
+ $oi_services = $this->getOpenIniviterPlugins();
19
+ $oi_types = $this->getOpenInviterTypes();
20
+ if ($step=='get_contacts')
21
+ {
22
+ ?>
23
+ <ul class="form-list" id="open_inviter_options">
24
+ <li>
25
+ <div class="left">
26
+ <label for="email_box" class="required"><em>*</em><?php echo $this->__('Your login:') ?></label><br/>
27
+ <div>
28
+ <input name="email_box" type="text" class="input-text required-entry" id="email_box" value="<?php echo $this->getOpenInviterEmailBox(); ?>" />
29
+ </div>
30
+ <div id="email_box_alert" style="display:none;" class="validation-advice"><?php echo $this->__('Field is required.') ?></div>
31
+ </div>
32
+ </li>
33
+ <li>
34
+ <div class='left'>
35
+ <label for="password_box" class="required"><em>*</em><?php echo $this->__('Password:') ?></label><br/>
36
+ <div><input name="password_box" type="password" class="input-text required-entry" id="password_box" value=""/></div>
37
+ </div>
38
+ </li>
39
+ <li>
40
+ <div class="left">
41
+ <label for="provider_box" class="required"><em>*</em><?php echo $this->__('Address book provider:') ?></label><br/>
42
+ <select class='select required-entry' name='provider_box' id='provider_box'><option value=''><?php echo $this->__('Choose your provider'); ?></option>
43
+ <?php
44
+ foreach ($oi_services as $type=>$providers)
45
+ {
46
+ echo "<optgroup label='{$oi_types[$type]}'>";
47
+ foreach ($providers as $provider=>$details)
48
+ echo "<option value='{$provider}'".($this->getOpenInviterProviderBox() == $provider ? 'selected' : '').">{$details['name']}</option>";
49
+ echo "</optgroup>";
50
+ }
51
+ ?>
52
+ </select>
53
+ </div>
54
+ </li>
55
+ </ul>
56
+ <div class="buttons-set">
57
+ <button class="button" type="submit"><span><?php echo $this->__('Import Contacts') ?></span></button>
58
+ <input type='hidden' name='step' value='get_contacts' />
59
+ </div>
60
+ </div>
61
+ <?php
62
+ }
63
+ ?>
64
+ </form>
65
+ <?php endif; ?>
66
+ <script type="text/javascript">
67
+ var openinviter = new VarienForm('openinviter', true);
68
+ </script>
app/design/frontend/default/default/template/sponsorship/openinviterimport.phtml ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ /**
3
+ * @category Auguria
4
+ * @package Auguria_Sponsorship
5
+ * @author Auguria
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ -->
9
+ <?php
10
+ if (Mage::getStoreConfig('sponsorship/open_inviter/open_inviter_enabled')==true):
11
+ ?>
12
+ <div id="messages_openinviter"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
13
+ <form action="" id="openinviterimport" method="post" onsubmit="addContacts(); return false;">
14
+ <div class="fieldset open_inviter_options">
15
+ <h2 class="legend"><?php echo $this->__('Select recipients from your address book:') ?></h2>
16
+ <?php
17
+ $step = $this->getOpenInviterStep();
18
+ if ($step=='send_invites'):
19
+ $contacts = $this->getOpenInviterContacts();
20
+ if (count($contacts)):
21
+ $counter = 0;
22
+ ?>
23
+ <div class="buttons-set">
24
+ <p class="back-link"><a href="<?php echo $this->getBackUrl() ?>"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
25
+ <button class="button" type="submit"><span><?php echo $this->__('Import selected contacts') ?></span></button>
26
+ <input type='hidden' name='step' value='get_contacts' />
27
+ </div>
28
+ <div class="clear">&nbsp;</div>
29
+ <ul class="form-list" id="open_inviter_options">
30
+ <li>
31
+ <input name='check_all' id='check_all' type='checkbox' checked="checked">
32
+ <span class='bold'><?php echo $this->__("Check or uncheck all"); ?></span>
33
+ </li>
34
+ <li>&nbsp;</li>
35
+ <?php foreach ($contacts as $email=>$name):
36
+ $counter++;
37
+ ?>
38
+ <li>
39
+ <input name='check' id='check_<?php echo $counter; ?>' value='<?php echo $counter; ?>' type='checkbox' checked="checked">
40
+ <span><?php echo $name.' &lt;'.$email.'&gt;'; ?></span>
41
+ <input type='hidden' name='email_<?php echo $counter; ?>' id='email_<?php echo $counter; ?>' value='<?php echo $email; ?>'>
42
+ <input type='hidden' name='name_<?php echo $counter; ?>' id='name_<?php echo $counter; ?>' value='<?php echo $name; ?>'>
43
+ </li>
44
+ <?php endforeach; ?>
45
+ </ul>
46
+ <div class="buttons-set">
47
+ <p class="back-link"><a href="<?php echo $this->getBackUrl() ?>"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
48
+ <button class="button" type="submit"><span><?php echo $this->__('Import selected contacts') ?></span></button>
49
+ <input type='hidden' name='step' value='get_contacts' />
50
+ </div>
51
+ <?php endif; ?>
52
+ <?php endif; ?>
53
+ </div>
54
+ </form>
55
+ <?php endif; ?>
56
+ <script type="text/javascript">
57
+ var openinviter = new VarienForm('openinviterimport', true);
58
+ Event.observe('check_all', 'click', function(event) {
59
+ if (document.getElementById('check_all').checked)
60
+ {
61
+ checkAll();
62
+ }
63
+ else
64
+ {
65
+ uncheckAll();
66
+ }
67
+ });
68
+
69
+ function checkAll()
70
+ {
71
+ var contacts = openinviter.form.elements;
72
+ for (i = 0; i < contacts.length; i++)
73
+ {
74
+ var contact = contacts[i];
75
+ if (contact.name == 'check')
76
+ {
77
+ contact.checked = 1;
78
+ }
79
+ }
80
+ }
81
+ function uncheckAll()
82
+ {
83
+ var contacts = openinviter.form.elements;
84
+ for (i = 0; i < contacts.length; i++)
85
+ {
86
+ var contact = contacts[i];
87
+ if (contact.name == 'check')
88
+ {
89
+ contact.checked = 0;
90
+ }
91
+ }
92
+ }
93
+
94
+ function addContacts()
95
+ {
96
+ var contacts = openinviter.form.elements;
97
+ for (i = 0; i < contacts.length; i++)
98
+ {
99
+ var contact = contacts[i];
100
+ if (contact.name == 'check' && contact.checked)
101
+ {
102
+ var name = document.getElementById('name_'+contact.value).value;
103
+ var email = document.getElementById('email_'+contact.value).value;
104
+ opener.add_recipient('', name, email);
105
+ }
106
+ }
107
+ self.close();
108
+ }
109
+ </script>
app/design/frontend/default/default/template/sponsorship/sponsorship.phtml CHANGED
@@ -14,39 +14,48 @@
14
  function remove_recipient(i){
15
  $('recipient_firstname'+i).up(2).remove();
16
  recipCount = recipCount-1;
17
- if(recipCount<maxRecip && maxRecip != 0) {
18
  $('add_recipient_button').show();
19
  $('max_recipient_message').hide();
20
  }
21
  return false;
22
  }
23
 
24
- function add_recipient(){
25
- ul = $('recipient_options');
26
- var li_mail = Element.extend(document.createElement("LI"));
27
- li_mail.addClassName('addElement');
28
-
29
- li_mail.innerHTML = '<div class="left"><label for="recipient_firstname" class="required"><em>*<\/em><?php echo $this->__('First name:') ?><\/label><br /><div style="width:250px"><input name="recipient[firstname][]" type="text" class="input-text required-entry" id="recipient_firstname'+i+'" style="width:250px;" /><\/div><\/div>';
30
- li_mail.innerHTML += '<div class="right"><label for="recipient_lastname" class="required"><em>*<\/em><?php echo $this->__('Last name:') ?><\/label><br /><div style="width:250px"><input name="recipient[lastname][]" type="text" class="input-text required-entry" id="recipient_lastname'+i+'" style="width:250px;" /><\/div><\/div>';
31
- li_mail.innerHTML += '<div class="left"><label for="recipient_email" class="required"><em>*<\/em><?php echo $this->__('Email Address:') ?><\/label><br /><div style="width:250px"><input name="recipient[email][]" value="" title="<?php echo $this->__('Email Address') ?>" id="recipient_email'+i+'" type="text" class="input-text required-entry validate-email" style="width:250px;" /><\/div><\/div>';
32
-
33
- li_mail.innerHTML += '<button style="margin-top:10px" class="button right" onclick="remove_recipient('+i+');" type="button"><span><?php echo $this->__('Remove Recipient') ?><\/span><\/button>';
34
- i++;
35
- recipCount++;
36
- if(recipCount>=maxRecip && maxRecip != 0) {
 
 
 
 
 
 
 
 
 
 
37
  $('add_recipient_button').hide();
38
  $('max_recipient_message').show();
39
- }
40
-
41
- ul.appendChild(li_mail);
42
  }
43
  //]]>
44
  </script>
 
45
  <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
46
  <div class="page-title">
47
  <h1><?php echo $this->__('Sponsor friends') ?></h1>
48
  </div>
49
- <form action="<?php echo $this->getUrl('sponsorship/index/post') ?>" id="sponsorship" method="post">
50
  <div class="fieldset sender_options">
51
  <h2 class="legend"><?php echo $this->__('Sender:') ?></h2>
52
  <ul class="form-list" id="sender_options">
@@ -70,7 +79,7 @@
70
  <div class="left">
71
  <label for="message_subject" class="required"><em>*</em><?php echo $this->__('Subject:') ?></label><br/>
72
  <div style="width:250px">
73
- <input name="message[subject]" value="<?php echo Mage::helper('sponsorship/mail')->getSubject() ?>" title="<?php echo $this->__('Subject') ?>" id="message_subject" type="text" class="input-text required-entry" style="width:250px;" />
74
  </div>
75
  </div>
76
  </li>
@@ -89,7 +98,7 @@
89
  <div>
90
  <label for="message_body" class="required"><em>*</em><?php echo $this->__('Your message:') ?></label>
91
  <textarea name="message[body]" class="input-text required-entry" id="message_body" title="<?php echo $this->__('Your message') ?>" cols="3" rows="8" style="width:100%;height:180px"><?php
92
- echo Mage::helper('sponsorship/mail')->getMessage();
93
  ?></textarea>
94
  </div>
95
  </li>
@@ -108,21 +117,19 @@
108
  </div>
109
  <div class="fieldset recipient_options">
110
  <h2 class="legend"><?php echo $this->__('Recipients:') ?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
111
  <ul class="form-list" id="recipient_options">
112
- <li>
113
- <div class="left">
114
- <label for="recipient_firstname" class="required"><em>*</em><?php echo $this->__('First name:') ?></label><br/>
115
- <div style="width:250px"><input name="recipient[firstname][]" type="text" class="input-text required-entry" id="recipient_firstname" style="width:250px;" /></div>
116
- </div>
117
- <div class="right">
118
- <label for="recipient_lastname" class="required"><em>*</em><?php echo $this->__('Last name:') ?></label><br/>
119
- <div style="width:250px"><input name="recipient[lastname][]" type="text" class="input-text required-entry" id="recipient_lastname" style="width:250px;" /></div>
120
- </div>
121
- <div class="left">
122
- <label for="recipient_email" class="required"><em>*</em><?php echo $this->__('Email Address:') ?></label><br/>
123
- <div style="width:250px"><input name="recipient[email][]" value="" title="<?php echo $this->__('Email Address') ?>" id="recipient_email" type="text" class="input-text required-entry validate-email" style="width:250px;" /></div>
124
- </div>
125
- </li>
126
  </ul>
127
  <div id="max_recipient_message" style="display:none">
128
  <?php if ($this->getMaxRecipients()): ?>
@@ -132,7 +139,7 @@
132
  <?php
133
  if (1 < $this->getMaxRecipients()): ?>
134
  <div id="add_recipient_button" class="buttons-set">
135
- <button class="button" onclick="add_recipient();" type="button"><span><?php echo $this->__('Add Recipient') ?></span></button>
136
  </div>
137
  <?php endif; ?>
138
  <div style="clear:both"></div>
@@ -145,5 +152,26 @@
145
  </form>
146
 
147
  <script type="text/javascript">
148
- var sponsorship = new VarienForm('sponsorship', true);
149
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  function remove_recipient(i){
15
  $('recipient_firstname'+i).up(2).remove();
16
  recipCount = recipCount-1;
17
+ if(recipCount<=maxRecip && maxRecip != 0) {
18
  $('add_recipient_button').show();
19
  $('max_recipient_message').hide();
20
  }
21
  return false;
22
  }
23
 
24
+ function add_recipient(firstname, lastname, email){
25
+ if(maxRecip == 0 || recipCount<=maxRecip)
26
+ {
27
+ ul = $('recipient_options');
28
+ var li_mail = Element.extend(document.createElement("LI"));
29
+ li_mail.addClassName('addElement');
30
+
31
+ li_mail.innerHTML = '<div class="left"><label for="recipient_firstname"><?php echo $this->__('First name:') ?><\/label><br /><div style="width:250px"><input name="recipient[firstname][]" type="text" class="input-text" id="recipient_firstname'+i+'" value="'+firstname+'" style="width:250px;" /><\/div><\/div>';
32
+ li_mail.innerHTML += '<div class="right"><label for="recipient_lastname" class="required"><em>*<\/em><?php echo $this->__('Last name:') ?><\/label><br /><div style="width:250px"><input name="recipient[lastname][]" value="'+lastname+'" type="text" class="input-text required-entry" id="recipient_lastname'+i+'" style="width:250px;" /><\/div><\/div>';
33
+ li_mail.innerHTML += '<div class="left"><label for="recipient_email" class="required"><em>*<\/em><?php echo $this->__('Email Address:') ?><\/label><br /><div style="width:250px"><input name="recipient[email][]" value="'+email+'" title="<?php echo $this->__('Email Address') ?>" id="recipient_email'+i+'" type="text" class="input-text required-entry validate-email" style="width:250px;" /><\/div><\/div>';
34
+
35
+ li_mail.innerHTML += '<button style="margin-top:10px" class="button right" onclick="remove_recipient('+i+');" type="button"><span><?php echo $this->__('Remove Recipient') ?><\/span><\/button>';
36
+ i++;
37
+ recipCount++;
38
+ if(recipCount>maxRecip && maxRecip != 0) {
39
+ $('add_recipient_button').hide();
40
+ $('max_recipient_message').show();
41
+ }
42
+
43
+ ul.appendChild(li_mail);
44
+ }
45
+ else
46
+ {
47
  $('add_recipient_button').hide();
48
  $('max_recipient_message').show();
49
+ }
 
 
50
  }
51
  //]]>
52
  </script>
53
+
54
  <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
55
  <div class="page-title">
56
  <h1><?php echo $this->__('Sponsor friends') ?></h1>
57
  </div>
58
+ <form action="<?php echo $this->getUrl('sponsorship/index/send') ?>" id="sponsorship" method="post">
59
  <div class="fieldset sender_options">
60
  <h2 class="legend"><?php echo $this->__('Sender:') ?></h2>
61
  <ul class="form-list" id="sender_options">
79
  <div class="left">
80
  <label for="message_subject" class="required"><em>*</em><?php echo $this->__('Subject:') ?></label><br/>
81
  <div style="width:250px">
82
+ <input name="message[subject]" value="<?php echo $this->getSubject(); ?>" title="<?php echo $this->__('Subject') ?>" id="message_subject" type="text" class="input-text required-entry" style="width:250px;" />
83
  </div>
84
  </div>
85
  </li>
98
  <div>
99
  <label for="message_body" class="required"><em>*</em><?php echo $this->__('Your message:') ?></label>
100
  <textarea name="message[body]" class="input-text required-entry" id="message_body" title="<?php echo $this->__('Your message') ?>" cols="3" rows="8" style="width:100%;height:180px"><?php
101
+ echo $this->getBodyMessage();
102
  ?></textarea>
103
  </div>
104
  </li>
117
  </div>
118
  <div class="fieldset recipient_options">
119
  <h2 class="legend"><?php echo $this->__('Recipients:') ?></h2>
120
+
121
+ <?php
122
+ /**
123
+ * Open Inviter
124
+ */
125
+ if (Mage::getStoreConfig('sponsorship/open_inviter/open_inviter_enabled')==true): ?>
126
+ <a href="<?php echo $this->getUrl('sponsorship/openinviter'); ?>" onclick='openPopup(this); return false'>
127
+ <?php echo $this->__('Select recipients from your address book.')?>
128
+ </a>
129
+ &nbsp;<?php echo $this->__('Or add recipient manually.')?>
130
+ <?php endif; ?>
131
+
132
  <ul class="form-list" id="recipient_options">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  </ul>
134
  <div id="max_recipient_message" style="display:none">
135
  <?php if ($this->getMaxRecipients()): ?>
139
  <?php
140
  if (1 < $this->getMaxRecipients()): ?>
141
  <div id="add_recipient_button" class="buttons-set">
142
+ <button class="button" onclick="add_recipient('','','');" type="button"><span><?php echo $this->__('Add Recipient') ?></span></button>
143
  </div>
144
  <?php endif; ?>
145
  <div style="clear:both"></div>
152
  </form>
153
 
154
  <script type="text/javascript">
155
+ var sponsorship = new VarienForm('sponsorship', true);
156
+ function openPopup(objet)
157
+ {
158
+ var largeur=600;
159
+ var hauteur=600;
160
+ var top=(screen.height-hauteur)/2;
161
+ var left=(screen.width-largeur)/2;
162
+ window.open(objet.href, "_blank", "menubar=no, scrollbars=yes, top="+top+",left="+left+",width="+largeur+",height="+hauteur);
163
+ }
164
+ <?php
165
+ $session = Mage::getSingleton('customer/session');
166
+ if (isset($session['sponsorship_form']['recipient']['email']) && count($session['sponsorship_form']['recipient']['email']))
167
+ {
168
+ foreach ($session['sponsorship_form']['recipient']['email'] as $key=>$email)
169
+ {
170
+ $firstname = $session['sponsorship_form']['recipient']['firstname'][$key];
171
+ $lastname = $session['sponsorship_form']['recipient']['lastname'][$key];
172
+ echo 'add_recipient("'.$firstname.'", "'.$lastname.'", "'.$email.'");
173
+ ';
174
+ }
175
+ }
176
+ ?>
177
+ </script>
app/locale/fr_FR/Auguria_Sponsorship.csv CHANGED
@@ -182,3 +182,19 @@
182
  "Your points exchanges:","Vos échanges de points :"
183
  "Your request has been submitted, you will soon receive an email confirmation.","Votre demande a bien été transmise, vous recevrez bientôt un mail de confirmation."
184
  "You do not have yet send invit.","Vous n'avez pas encore envoyé d'invitation."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  "Your points exchanges:","Vos échanges de points :"
183
  "Your request has been submitted, you will soon receive an email confirmation.","Votre demande a bien été transmise, vous recevrez bientôt un mail de confirmation."
184
  "You do not have yet send invit.","Vous n'avez pas encore envoyé d'invitation."
185
+ "Select recipients from your address book.","Sélectionnez les destinataires dans votre carnet d'adresses."
186
+ "Or add recipient manually.","Ou ajoutez vos destinataires manuellement."
187
+ "Select your provider and sign in:","Sélectionnez votre fournisseur et identifiez vous :"
188
+ "Your login:","Votre identifiant :"
189
+ "Address book provider:","Fournisseur de carnet d'adresse :"
190
+ "Import Contacts","Importer contacts"
191
+ "Login failed. Please check the email and password you have provided and try again later !","L'authentification a échouée. Merci de vérifier votre identifiant et votre mot de passe."
192
+ "Please enter the full email, not just the username","Merci d'indiquer votre email, et pas seulement votre nom d'utilisateur."
193
+ "Select recipients from your address book:","Sélectionnez les destinataires dans votre carnet d'adresses :"
194
+ "Import selected contacts","Importer les contacts sélectionnés"
195
+ "Check or uncheck all","Tout sélectionner ou tout de-sélectionner"
196
+ "Email missing !","Il manque l'email !"
197
+ "Password missing !","Il manque le mot de passe !"
198
+ "Provider missing !","Il manque le fournisseur !"
199
+ "Unable to get contacts !","Impossible de récupérer les contacts !"
200
+ "An exception occured !","Une exception s'est produite !"
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Auguria_Sponsorship</name>
4
- <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
@@ -26,9 +26,9 @@ Once installed, you must:
26
  - If you enable automatic sponsorship recall, activate magento cron</description>
27
  <notes>If you have ideas for improvements or find bugs, please send them to Franck Charpentier at www.auguria.net, with Auguria LastReviews as part of the subject line.</notes>
28
  <authors><author><name>Auguria</name><user>auto-converted</user><email>magento@auguria.net</email></author></authors>
29
- <date>2010-06-07</date>
30
- <time>08:42:55</time>
31
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="sponsorship.xml" hash="6e2160aad7460856353fe291d000a39c"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="sponsorship.xml" hash="2cd6dd0e36f46f79ddb0f41903cf32cf"/></dir><dir name="template"><dir name="sponsorship"><dir name="customer"><dir name="account"><dir name="dashboard"><file name="fidelity_points.phtml" hash="41131e636284b1a2dcdbc79be86c6768"/><file name="sponsor_points.phtml" hash="a510e2612ffc9730644e21924603e190"/></dir><file name="dashboard.phtml" hash="b3c531f03302819338ebd9739b144d5f"/><file name="fidelitypointsdetail.phtml" hash="ac569b80b7dfda7412a265e88e51d403"/><file name="sponsorpointsdetail.phtml" hash="0a45d3ef02a05607ea46dedb631359c6"/></dir><dir name="form"><dir name="pointschange"><file name="pointschange_cash.phtml" hash="d181ffed79eec08a0a65e78e3aa731f8"/><file name="pointschange_coupon.phtml" hash="88870799ae481ba3a62209042aa4344d"/><file name="pointschange_gift.phtml" hash="29a244c931252894b98e1a9bf1c40fc4"/></dir><file name="boost.phtml" hash="c81f986b3a40771f9652a5b9f264ba20"/><file name="edit.phtml" hash="4a55e415cf16a47c584bcbbba570d8a5"/><file name="pointschange.phtml" hash="98fced0f1ac113b79e14521fea151afc"/><file name="register.phtml" hash="52b5e45974ecf7898851b2983c496297"/></dir><dir name="widget"><file name="name.phtml" hash="167d0c09817b6a786e017e54c7117a76"/><file name="virement.phtml" hash="275ebb5903affe9462a1307cec452053"/></dir></dir><file name="sponsorship.phtml" hash="7ae1e5221b5055c2954a5416e33e4fa8"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Auguria_Sponsorship.xml" hash="2ace21d88c17b2636514543e866169eb"/></dir></dir></dir><dir name="js"><dir name="tableorderer"><file name="table_orderer.js" hash="f23c21e5031d7218f83c9117cf7442eb"/></dir></dir></target><target name="magecommunity"><dir name="Auguria"><dir name="Sponsorship"><dir name="Block"><dir name="Adminhtml"><dir name="Change"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="cd94427577e45107683ea305a557f9d8"/></dir><file name="Form.php" hash="ae7412b583874b8fffc05cc3897f1a2b"/><file name="Tabs.php" hash="14027188a77ed427a54211d61471c962"/></dir><file name="Edit.php" hash="5c266273137c23f763d39d93f5ef82b4"/><file name="Grid.php" hash="9962a69732ae93157eb99ff663608203"/></dir><dir name="Link"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="98a2a13987cb165ee5233dcef0927daa"/></dir><file name="Form.php" hash="e6e087ae96b24d4edbe9e1f578e7a55a"/><file name="Tabs.php" hash="7d67a25094cf51ced551a8b3e21155c1"/></dir><file name="Edit.php" hash="bb82a0a9cd963648d7e6e34c616a0122"/><file name="Grid.php" hash="80d52f01c060d2c3b3b79c820adf8f16"/></dir><dir name="Sponsorship"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="686b9a9a14d57e0f2e7edcf3d4e0416a"/></dir><file name="Form.php" hash="a3a2352db1c72663af0caa289287a9d2"/><file name="Tabs.php" hash="257863f6b317e37110dacc86b783565b"/></dir><file name="Edit.php" hash="40ea8077f12545878ddc0cd0ad2f8cad"/><file name="Grid.php" hash="83a98d5005f4b89dfa275ddea3355c16"/></dir><file name="Change.php" hash="e5cd05ce0f684c462ec3b757982e0c97"/><file name="Link.php" hash="596e2a5247d5f8c1848cb612e15e68c0"/><file name="Sponsorship.php" hash="0ae7db005eaa0481735f41061bff5122"/></dir><dir name="Customer"><dir name="Account"><file name="PointsDetail.php" hash="365a9fc8dfc660fcef3dbbe0a131d289"/></dir><dir name="Form"><file name="Boost.php" hash="33cd49ab1ceed2816feb1d45b1c7a69b"/><file name="PointsChange.php" hash="92a71fe4f081b6c3b85cc645419fac04"/></dir><dir name="Widget"><file name="Name.php" hash="3c82b2d67f219ae56ac37526f72268fe"/><file name="Virement.php" hash="ba25badce7295811fe5deeafa284c114"/></dir></dir><dir name="Promo"><dir name="Catalog"><dir name="Edit"><dir name="Tab"><file name="Actions.php" hash="f5926196fd291cb45c13b5a8e1c018b6"/></dir></dir></dir><dir name="Quote"><dir name="Edit"><dir name="Tab"><file name="Actions.php" hash="4ff4de9b5e4d5200111d602625f91362"/></dir></dir></dir></dir><file name="Sponsorship.php" hash="a2fc28dc91b74e3bb51df20efe599522"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ChangeController.php" hash="73c1db83413cdf077562f8fb8d4bd8ec"/><file name="LinkController.php" hash="8f6c0efd94f22c15ffd2dd0f287a0e5e"/><file name="SponsorshipController.php" hash="fff66a866f773ed8f6d3708c9e0d644f"/></dir><dir name="Customer"><file name="AccountController.php" hash="2986c03548b6ff85c2ba016dea953598"/></dir><file name="BoostController.php" hash="c23cca5dfd34c8975f785e7973aa4d79"/><file name="FidelitypointsController.php" hash="7911af35af4a33da338f6d9db0f6b224"/><file name="IndexController.php" hash="6a0d89d1acf6529dc56cf7eb73db5f6b"/><file name="SponsorController.php" hash="695e53a80e094e7d5bfe2fde8eb45bb2"/><file name="SponsorpointsController.php" hash="71a221400c548c44d73a4715078ec51a"/></dir><dir name="etc"><file name="config.xml" hash="3c2623e5d74aa87a73b097b1f54f7e12"/><file name="system.xml" hash="25a9635ec75e9fdabae08d9c47aec44b"/></dir><dir name="Helper"><file name="Data.php" hash="10e2e7c3408665a07464cd6c20bf1550"/><file name="Mail.php" hash="867081c98161687a1e9d502fb23473d0"/></dir><dir name="Lib"><file name="Html2Text.php" hash="4bd5cf3bd59121ffa9d15b9a60a56ca4"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Sponsorship"><file name="Entier.php" hash="cb45db31cab4b797103d686e03404d6d"/><file name="Float.php" hash="35b76ecdc9065ae9aef1acdee66ab57c"/></dir></dir></dir></dir></dir><dir name="Core"><dir name="Email"><file name="Template.php" hash="5ad7985013fff5f28cd76bbec0a71c22"/></dir></dir><dir name="Customer"><file name="Customer.php" hash="1ee0fbe7c2ce96fac9f7dfc97e179a9e"/></dir><dir name="Mysql4"><dir name="CatalogFidelityPoint"><file name="Collection.php" hash="b151b96d8370ea1fe9e309559fb04573"/></dir><dir name="CatalogSponsorPoint"><file name="Collection.php" hash="a56b2950a04ae446dcf82ad4bdfadb07"/></dir><dir name="Change"><file name="Collection.php" hash="99a67418cc7b573f285c04a5d7f6020d"/></dir><dir name="FidelityLog"><file name="Collection.php" hash="7230b303a336da8167709168410c0531"/></dir><dir name="Sponsorlog"><file name="Collection.php" hash="8efa2fb23ec7a6ad2373395ff4739f1e"/></dir><dir name="Sponsorship"><file name="Collection.php" hash="bea288d9bdc6faee88795895eb5bd6ee"/></dir><file name="CatalogFidelityPoint.php" hash="ab4402569102622be8264d135768afbc"/><file name="CatalogSponsorPoint.php" hash="f34d98e76da49afe1e2049dcb3c73626"/><file name="Change.php" hash="fcc6ad58aae6b4051fa997c03b5b5756"/><file name="Fidelitylog.php" hash="47a37a5374c82d3428a6bcc301316ce8"/><file name="Rule.php" hash="2ee2d8879d6ac0be3432e1e5334d77cf"/><file name="Sponsorlog.php" hash="97bde1eef9156b5a20f5f2f92a6fee03"/><file name="Sponsorship.php" hash="2c6d63261112e53a9c442ea3568e2e32"/></dir><file name="AutoBoost.php" hash="5b2527368d08cade3495819a823ff8f7"/><file name="Change.php" hash="c4e3f0cd6077fab4ebc7e078d031fc3d"/><file name="Changestatut.php" hash="21106c8021072b8f8cf8419fec0ad0a9"/><file name="EmptyPHP.php" hash="e4375ede533ff3a0500d327e14b7ff54"/><file name="Fidelitylog.php" hash="1644dc508b0a1c4d06397a48509f652c"/><file name="Observer.php" hash="6455d60700e344fb7fb23213951be5e6"/><file name="Sponsorlog.php" hash="834b0e8e29eff5061abb18621a22ddb5"/><file name="Sponsorship.php" hash="acd91d3c6a6dbe801e7dde41a8d2fb06"/><file name="Status.php" hash="ad5779cf7a0887635315b74827780063"/><file name="Validator.php" hash="87d39a07bff5133894f8334f9f5fe967"/></dir><dir name="sql"><dir name="sponsorship_setup"><file name="mysql4-install-0.1.0.php" hash="cde2a97370601a046bcc559e22a7cdb8"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="99c4e9b7ab6d3aab2477195310482242"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="08dc31268dcb35b68abbc4c179f7ed03"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="9966b88c1e297dd4cae297859e4034a0"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="0d55e5801c8e4031aeece7787ffc94c1"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="6de811c47e0031c134a8343e230ca451"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="d6f43e969bf07f5859b1f251540c358d"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="5289d74fa889d0046a19d9714df5572b"/><file name="mysql4-upgrade-0.1.7-0.1.8.php" hash="89acdec2f7785fc2e6e82ff6265e439a"/><file name="mysql4-upgrade-0.1.8-0.1.9.php" hash="02158b6524f5d24c8e9d07022da2aa27"/><file name="mysql4-upgrade-0.1.9-0.1.10.php" hash="b29284b6cf0df556810ed3bdb47fd7dc"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="sponsorship_coupon.html" hash="0ca5d0c23070e0a6a9f9822ad9612678"/><file name="sponsorship_invitation.html" hash="30fe91c3b83ee223f6bffb3dd779dd26"/></dir></dir></dir><dir name="fr_FR"><dir name="template"><dir name="email"><file name="sponsorship_coupon.html" hash="bbd873e171d6a9ca5f46e04314c39624"/><file name="sponsorship_invitation.html" hash="30fe91c3b83ee223f6bffb3dd779dd26"/></dir></dir><file name="Auguria_Sponsorship.csv" hash="d859fc335ff27d074ba862db5d616a57"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="tableorderer.css" hash="30454132306ff6ac4dcf190aa922b7cc"/></dir><dir name="images"><dir name="tableorderer"><file name="asc.gif" hash="a54846803de3cc786eec3d69f9ac2d38"/><file name="bg.gif" hash="c01ad2e7c59d1a20a433cb873c21bd88"/><file name="bkg_toolbar.gif" hash="fb7ed019476eaa1643af922b59ede4fb"/><file name="desc.gif" hash="f8a1940c9cf44ab8870319169f3a14ff"/></dir></dir></dir></dir></dir></target></contents>
32
  <compatible/>
33
  <dependencies/>
34
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Auguria_Sponsorship</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
26
  - If you enable automatic sponsorship recall, activate magento cron</description>
27
  <notes>If you have ideas for improvements or find bugs, please send them to Franck Charpentier at www.auguria.net, with Auguria LastReviews as part of the subject line.</notes>
28
  <authors><author><name>Auguria</name><user>auto-converted</user><email>magento@auguria.net</email></author></authors>
29
+ <date>2010-06-17</date>
30
+ <time>10:36:44</time>
31
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="sponsorship.xml" hash="6e2160aad7460856353fe291d000a39c"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="sponsorship.xml" hash="8d7ead600805bdd2cc66a0e67a26dcf4"/></dir><dir name="template"><dir name="sponsorship"><dir name="customer"><dir name="account"><dir name="dashboard"><file name="fidelity_points.phtml" hash="41131e636284b1a2dcdbc79be86c6768"/><file name="sponsor_points.phtml" hash="a510e2612ffc9730644e21924603e190"/></dir><file name="dashboard.phtml" hash="b3c531f03302819338ebd9739b144d5f"/><file name="fidelitypointsdetail.phtml" hash="ac569b80b7dfda7412a265e88e51d403"/><file name="sponsorpointsdetail.phtml" hash="0a45d3ef02a05607ea46dedb631359c6"/></dir><dir name="form"><dir name="pointschange"><file name="pointschange_cash.phtml" hash="d181ffed79eec08a0a65e78e3aa731f8"/><file name="pointschange_coupon.phtml" hash="88870799ae481ba3a62209042aa4344d"/><file name="pointschange_gift.phtml" hash="29a244c931252894b98e1a9bf1c40fc4"/></dir><file name="boost.phtml" hash="c81f986b3a40771f9652a5b9f264ba20"/><file name="edit.phtml" hash="4a55e415cf16a47c584bcbbba570d8a5"/><file name="pointschange.phtml" hash="98fced0f1ac113b79e14521fea151afc"/><file name="register.phtml" hash="52b5e45974ecf7898851b2983c496297"/></dir><dir name="widget"><file name="name.phtml" hash="167d0c09817b6a786e017e54c7117a76"/><file name="virement.phtml" hash="275ebb5903affe9462a1307cec452053"/></dir></dir><file name="openinviter.phtml" hash="585bacec14882277c494fdeb341a36c6"/><file name="openinviterimport.phtml" hash="8e468750660c4b2556f4f1e1b50bfafb"/><file name="sponsorship.phtml" hash="9eb72b1beedb2f279d4b73bd24833559"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Auguria_Sponsorship.xml" hash="2ace21d88c17b2636514543e866169eb"/></dir></dir></dir><dir name="js"><dir name="tableorderer"><file name="table_orderer.js" hash="f23c21e5031d7218f83c9117cf7442eb"/></dir></dir></target><target name="magecommunity"><dir name="Auguria"><dir name="Sponsorship"><dir name="Block"><dir name="Adminhtml"><dir name="Change"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="cd94427577e45107683ea305a557f9d8"/></dir><file name="Form.php" hash="ae7412b583874b8fffc05cc3897f1a2b"/><file name="Tabs.php" hash="14027188a77ed427a54211d61471c962"/></dir><file name="Edit.php" hash="5c266273137c23f763d39d93f5ef82b4"/><file name="Grid.php" hash="9962a69732ae93157eb99ff663608203"/></dir><dir name="Link"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="98a2a13987cb165ee5233dcef0927daa"/></dir><file name="Form.php" hash="e6e087ae96b24d4edbe9e1f578e7a55a"/><file name="Tabs.php" hash="7d67a25094cf51ced551a8b3e21155c1"/></dir><file name="Edit.php" hash="bb82a0a9cd963648d7e6e34c616a0122"/><file name="Grid.php" hash="a141a2ecd313131a3282885b7781268c"/></dir><dir name="Sponsorship"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="686b9a9a14d57e0f2e7edcf3d4e0416a"/></dir><file name="Form.php" hash="a3a2352db1c72663af0caa289287a9d2"/><file name="Tabs.php" hash="257863f6b317e37110dacc86b783565b"/></dir><file name="Edit.php" hash="40ea8077f12545878ddc0cd0ad2f8cad"/><file name="Grid.php" hash="83a98d5005f4b89dfa275ddea3355c16"/></dir><file name="Change.php" hash="e5cd05ce0f684c462ec3b757982e0c97"/><file name="Link.php" hash="596e2a5247d5f8c1848cb612e15e68c0"/><file name="Sponsorship.php" hash="0ae7db005eaa0481735f41061bff5122"/></dir><dir name="Customer"><dir name="Account"><file name="PointsDetail.php" hash="365a9fc8dfc660fcef3dbbe0a131d289"/></dir><dir name="Form"><file name="Boost.php" hash="33cd49ab1ceed2816feb1d45b1c7a69b"/><file name="PointsChange.php" hash="92a71fe4f081b6c3b85cc645419fac04"/></dir><dir name="Widget"><file name="Name.php" hash="3c82b2d67f219ae56ac37526f72268fe"/><file name="Virement.php" hash="ba25badce7295811fe5deeafa284c114"/></dir></dir><dir name="Promo"><dir name="Catalog"><dir name="Edit"><dir name="Tab"><file name="Actions.php" hash="f5926196fd291cb45c13b5a8e1c018b6"/></dir></dir></dir><dir name="Quote"><dir name="Edit"><dir name="Tab"><file name="Actions.php" hash="4ff4de9b5e4d5200111d602625f91362"/></dir></dir></dir></dir><file name="Openinviter.php" hash="3051e44a791ccab457a37cef01357bd5"/><file name="Sponsorship.php" hash="3a6b5f091ead77d6ec136b84e1a77c7c"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ChangeController.php" hash="73c1db83413cdf077562f8fb8d4bd8ec"/><file name="LinkController.php" hash="8f6c0efd94f22c15ffd2dd0f287a0e5e"/><file name="SponsorshipController.php" hash="fff66a866f773ed8f6d3708c9e0d644f"/></dir><dir name="Customer"><file name="AccountController.php" hash="2986c03548b6ff85c2ba016dea953598"/></dir><file name="BoostController.php" hash="c23cca5dfd34c8975f785e7973aa4d79"/><file name="FidelitypointsController.php" hash="7911af35af4a33da338f6d9db0f6b224"/><file name="IndexController.php" hash="e394a4d3f448e40f5461c16c80acefbf"/><file name="OpeninviterController.php" hash="fcc7b92fb34c01e2ddbde013688f80ab"/><file name="SponsorController.php" hash="b81147d898f8903d5167ab0eed14a8ed"/><file name="SponsorpointsController.php" hash="71a221400c548c44d73a4715078ec51a"/></dir><dir name="etc"><file name="config.xml" hash="dae2ab0f26f7f7b232807d8fd24c533d"/><file name="system.xml" hash="a816c0060972cf907bad0d604d82b23f"/></dir><dir name="Helper"><file name="Data.php" hash="10e2e7c3408665a07464cd6c20bf1550"/><file name="Mail.php" hash="9dde8399b8afb7e45347c1b7bc667c3a"/></dir><dir name="Lib"><dir name="OpenInviter"><dir name="conf"><file name="abv.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="aol.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="apropo.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="atlas.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="aussiemail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="azet.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="badoo.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="bebo.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="bigstring.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="bookcrossing.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="bordermail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="brazencareerist.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="canoe.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="care2.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="clevergo.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="cyworld.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="doramail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="eons.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="evite.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="facebook.conf" hash="12cfb187449596c39774c4ac193295cc"/><file name="faces.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="famiva.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="fastmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="fdcareer.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="flickr.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="flingr.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="flixster.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="fm5.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="freemail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="friendfeed.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="friendster.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="gawab.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="gmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="gmx_net.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="graffiti.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="hi5.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="hotmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="hushmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="hyves.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="inbox.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="india.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="indiatimes.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="inet.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="interia.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="katamail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="kids.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="kincafe.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="konnects.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="koolro.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="lastfm.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="libero.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="linkedin.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="livejournal.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="lovento.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="lycos.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mail2world.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mail_com.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mail_in.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mail_ru.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="meinvz.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="meta.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mevio.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="motortopia.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="msn.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="multiply.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="mycatspace.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="mydogspace.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="mynet.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="myspace.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="netaddress.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="netlog.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="ning.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="nz11.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="o2.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="operamail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="orkut.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="perfspot.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="plaxo.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="plazes.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="plurk.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="pochta.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="popstarmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="rambler.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="rediff.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="sapo.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="skyrock.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="tagged.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="techemail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="terra.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="twitter.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="uk2.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="vimeo.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="virgilio.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="vkontakte.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="walla.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="web_de.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="wpl.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="xanga.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="xing.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="xuqa.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="yahoo.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="yandex.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="youtube.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="zapak.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="_hosted.conf" hash="1d09309103e660729b492433acda9822"/></dir><dir name="images"><file name="ers.gif" hash="cccdfd4ed0795b767d2a01f531781c10"/><file name="oks.gif" hash="6b4b170c9f10a0fa4b25307dd8f47e5b"/></dir><dir name="plugins"><file name="abv.plg.php" hash="1685755eae909c468055b9b36c915822"/><file name="aol.plg.php" hash="71a7666b0a145aae1ac5413ff789973d"/><file name="apropo.plg.php" hash="4426f976c1953383cf9d1f892aa9576e"/><file name="atlas.plg.php" hash="0b8e4237970ae54ff20187f5e861f972"/><file name="aussiemail.plg.php" hash="d40188b33455b3fd2e88cbde25f61709"/><file name="azet.plg.php" hash="e4a7c19450ca1ad84783a06ae3b1d61f"/><file name="badoo.plg.php" hash="b1d4863a173a80fc9d77331f1e60f2df"/><file name="bebo.plg.php" hash="2d7db898c660380ee74963667bec6bae"/><file name="bigstring.plg.php" hash="bb2f4d7d968bf43b4a9fad9ff52fd2ad"/><file name="bookcrossing.plg.php" hash="212a53a3a95659c56e15d6848549e25e"/><file name="bordermail.plg.php" hash="30190fa3da58d63ddd7e30e6ab0190dc"/><file name="brazencareerist.plg.php" hash="c68f39b6d7a07550abd63ed044ad85c2"/><file name="canoe.plg.php" hash="8b3ff7aefeb8d18a7199f6458ef89a16"/><file name="care2.plg.php" hash="c066e81973194cca90036c37c7740937"/><file name="clevergo.plg.php" hash="9bd12fea0eb7f60043bcdca9116cb1bc"/><file name="cyworld.plg.php" hash="1c960c9bb19897621dd4c26666dd5ae6"/><file name="doramail.plg.php" hash="81037085958f90a05111ad030c5a72f8"/><file name="eons.plg.php" hash="35009d6e25ae5584c554808b50145a19"/><file name="evite.plg.php" hash="d6c8acf7c24c2848eccedb269928d6eb"/><file name="facebook.plg.php" hash="179983b943c1b96aa9421776eaecf991"/><file name="faces.plg.php" hash="f71786a835cf05eeec142b85df5a6baa"/><file name="famiva.plg.php" hash="eee1c0a9a6d645baf014245ca2e9c3e9"/><file name="fastmail.plg.php" hash="e90fc58235f2300042d7171bbeb8c8e3"/><file name="fdcareer.plg.php" hash="aad3d525fe09269de056f8ec03e43104"/><file name="flickr.plg.php" hash="217a5e6b3393253da0c32d256f52fe20"/><file name="flingr.plg.php" hash="c2b415851babadb8048609874b411979"/><file name="flixster.plg.php" hash="773fad1c2c1775fcb74fb33f51d1fa24"/><file name="fm5.plg.php" hash="0576df91534edaab3d6b333d1968781a"/><file name="freemail.plg.php" hash="142951e9c20ce4447f44c6db7e5cc2e8"/><file name="friendfeed.plg.php" hash="399c987766110735fdd301979997fe48"/><file name="friendster.plg.php" hash="8b3402876a73bf91a84d3a6d8dbb1951"/><file name="gawab.plg.php" hash="db1174c45ad0c35cce642a0dc1a825a1"/><file name="gmail.plg.php" hash="a4a288e002543c4e167a8ff4540b3ee0"/><file name="gmx_net.plg.php" hash="218b73370a1367455aeee09695bc4e2a"/><file name="graffiti.plg.php" hash="36f6a6f03fceb9b0e008c1a281a17eb2"/><file name="hi5.plg.php" hash="6fbabcad8d4c16eeb7374bbc27b8c979"/><file name="hotmail.plg.php" hash="3dece5995f04e557641c3ea0cea91cd9"/><file name="hushmail.plg.php" hash="d3f9f339ac03c8aa2426f7a2fe4f2606"/><file name="hyves.plg.php" hash="4dca8f35b17070c42bd16fd86352baf3"/><file name="inbox.plg.php" hash="34066ac6458b6506921e11dde302e3c2"/><file name="india.plg.php" hash="cdd4e86f5b21122b2ebf898eb78b0311"/><file name="indiatimes.plg.php" hash="bbbda190c92579f469f0b4712ba9806f"/><file name="inet.plg.php" hash="6bc3da45b492ba41012b25e501c05273"/><file name="interia.plg.php" hash="3fb3cb41913d12228f162ac32539a848"/><file name="katamail.plg.php" hash="2c2c85f1cab23f236295e5340da10511"/><file name="kids.plg.php" hash="5fae2d825799b0793e2b131162ec8e07"/><file name="kincafe.plg.php" hash="39f0d662293f3db3bd9b0bb9e57b8e27"/><file name="konnects.plg.php" hash="0fd4bc3f8361fb7e5f04d277b4f7f121"/><file name="koolro.plg.php" hash="ebc1936657a99eb8b96ee178d9b7e15c"/><file name="lastfm.plg.php" hash="a293d4bde8a36b1868ddc432e1f201e6"/><file name="libero.plg.php" hash="29cbf372f39d77fd0b62d0777ded4317"/><file name="linkedin.plg.php" hash="12d71c803adf655dd865d9dd91fb1066"/><file name="livejournal.plg.php" hash="c9c4bd30963d28eee5038841a7d7c788"/><file name="lovento.plg.php" hash="e26c7fe712efdd69fe3788b02ebf514b"/><file name="lycos.plg.php" hash="41a133d41ef4627b353b0f33149629c0"/><file name="mail2world.plg.php" hash="5737b208425e9d03988303d1c20baac6"/><file name="mail_com.plg.php" hash="5d2c20c61d5ba58c4e4c4fc6e162cb20"/><file name="mail_in.plg.php" hash="bf443e42022a368819bcbb788baaa095"/><file name="mail_ru.plg.php" hash="a911e588bc6e8b790dad186ba2221d0c"/><file name="meinvz.plg.php" hash="bdfc89d072c231e39d7e3dccf12b1a22"/><file name="meta.plg.php" hash="17bd2e282a8509a14c2d440ea02d8961"/><file name="mevio.plg.php" hash="d175cd50dc07d749e7118a3a3b836800"/><file name="motortopia.plg.php" hash="507c050bb6e0cc73884c427d4745c7a0"/><file name="msn.plg.php" hash="2a205b0556aa7b8908dca3b15017db4f"/><file name="multiply.plg.php" hash="e4a780350ba171c890a84999a6389206"/><file name="mycatspace.plg.php" hash="1282b9619ddfcba5d924c0e31ea74cc7"/><file name="mydogspace.plg.php" hash="be44672096adbe4e2532d0a9df027b5f"/><file name="mynet.plg.php" hash="a2a38a688707957e216d3868c8b1741e"/><file name="myspace.plg.php" hash="7b84d123a8be4cc8b0c11b8fd01a0e6e"/><file name="netaddress.plg.php" hash="8e2ccf82123f831b2616c8d3a80f579f"/><file name="netlog.plg.php" hash="dfb64b43a3954bfa5d01d34d2cba4d80"/><file name="ning.plg.php" hash="e59cb73b203a22978ead363c49e48d3d"/><file name="nz11.plg.php" hash="b94995c177198c061b628ddc82d4c7fc"/><file name="o2.plg.php" hash="8e44c5027c493fff7be428ff034f0466"/><file name="operamail.plg.php" hash="5e3a90f0be46b03bcde54eebd76371c9"/><file name="orkut.plg.php" hash="1a291548a82889b36f976bd091260aa5"/><file name="perfspot.plg.php" hash="9d4a9b33f8cf809e5c73bfc517af53db"/><file name="plaxo.plg.php" hash="203f949a4e22b737de2003eb4d3c8af3"/><file name="plazes.plg.php" hash="f6d71432926c126d7f165e6c83a16854"/><file name="plurk.plg.php" hash="e780f5cdd31029cc1b153a1c5b14a965"/><file name="pochta.plg.php" hash="b5732832c05bf982a5950fa32ee4d62a"/><file name="popstarmail.plg.php" hash="a36517a17fa2a461ab890861a4c452fd"/><file name="rambler.plg.php" hash="2a72cbe3e0c12ca123f00f2d113ba02e"/><file name="rediff.plg.php" hash="5679b17973310ecf1ba8b097d3acffaa"/><file name="sapo.plg.php" hash="2bd76d540c454da5f014eba59074e835"/><file name="skyrock.plg.php" hash="4d7497a380a839f28611a21ddea55a89"/><file name="tagged.plg.php" hash="d3ade2b837b7550a09d26d3bc1bd9823"/><file name="techemail.plg.php" hash="9894baf3c22e835dbcf62796327d9f99"/><file name="terra.plg.php" hash="094ae4ab8e63dd0f075a860c9aba2094"/><file name="twitter.plg.php" hash="13482b4ca74e66965a9e9233745b6316"/><file name="uk2.plg.php" hash="ca5238d090e6a65709302a149caf5ffb"/><file name="vimeo.plg.php" hash="de5ab46f0cc5919b242c5b200f0ef724"/><file name="virgilio.plg.php" hash="38df3729142bd2b40792b7a1793446b7"/><file name="vkontakte.plg.php" hash="7db9b7a03e8f4ee2d2d7f5192ec18912"/><file name="walla.plg.php" hash="5340dda0d54849d2e313ab97015db215"/><file name="web_de.plg.php" hash="d3ed9a0c556f08bc5c67f978c7be4727"/><file name="wpl.plg.php" hash="b151407c39c360f49ffb9ca9fd73b32b"/><file name="xanga.plg.php" hash="89b5c2c3db98e735e4d1f19fb1c81786"/><file name="xing.plg.php" hash="2ff8238e6c1e4a08fbe3759d6e627ee8"/><file name="xuqa.plg.php" hash="1219e94f6ef0919025b2c93741e55fbd"/><file name="yahoo.plg.php" hash="50ed7830c0eada02daa7094ca26da87b"/><file name="yandex.plg.php" hash="922e9adc2a936bd6e83aaf331bb7c0b7"/><file name="youtube.plg.php" hash="fc05c436e6c2dd1c6c8fa336e7e893c5"/><file name="zapak.plg.php" hash="2274bd725d3bda8df0ae9d45d3ce1470"/><file name="_base.php" hash="5f7ba1cda90618b60ec44d9ea21afaa1"/><file name="_hosted.plg.php" hash="69514e56e1833df16884b6762bc620ce"/></dir><file name="autoupdate.php" hash="df781d645e37271f23432bb82b3360a2"/><file name="config.php" hash="214c7c6c115e1c8a21b9db03bfb9f64f"/><file name="LICENSE.txt" hash="277c3d400c7488e54746141297a952cb"/><file name="notifier.php" hash="88e3be687de995aae52a8ce248c49bce"/><file name="openinviter.php" hash="3f4ec8433193611284fd5fe2e91a3898"/><file name="POLICY.txt" hash="6262372bc84e172c7fd89d9ac61f9794"/><file name="stats.php" hash="5af8362ab3e9f89f5e8560b2623f767a"/></dir><file name="Html2Text.php" hash="4bd5cf3bd59121ffa9d15b9a60a56ca4"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Sponsorship"><file name="Entier.php" hash="cb45db31cab4b797103d686e03404d6d"/><file name="Float.php" hash="35b76ecdc9065ae9aef1acdee66ab57c"/><file name="Openinviter.php" hash="56bfee472079b2e70d87eb5242fa3d64"/></dir></dir></dir></dir></dir><dir name="Core"><dir name="Email"><file name="Template.php" hash="5ad7985013fff5f28cd76bbec0a71c22"/></dir></dir><dir name="Customer"><file name="Customer.php" hash="1ee0fbe7c2ce96fac9f7dfc97e179a9e"/></dir><dir name="Mysql4"><dir name="CatalogFidelityPoint"><file name="Collection.php" hash="b151b96d8370ea1fe9e309559fb04573"/></dir><dir name="CatalogSponsorPoint"><file name="Collection.php" hash="a56b2950a04ae446dcf82ad4bdfadb07"/></dir><dir name="Change"><file name="Collection.php" hash="99a67418cc7b573f285c04a5d7f6020d"/></dir><dir name="FidelityLog"><file name="Collection.php" hash="7230b303a336da8167709168410c0531"/></dir><dir name="Sponsorlog"><file name="Collection.php" hash="8efa2fb23ec7a6ad2373395ff4739f1e"/></dir><dir name="Sponsorship"><file name="Collection.php" hash="bea288d9bdc6faee88795895eb5bd6ee"/></dir><file name="CatalogFidelityPoint.php" hash="ab4402569102622be8264d135768afbc"/><file name="CatalogSponsorPoint.php" hash="f34d98e76da49afe1e2049dcb3c73626"/><file name="Change.php" hash="fcc6ad58aae6b4051fa997c03b5b5756"/><file name="Fidelitylog.php" hash="47a37a5374c82d3428a6bcc301316ce8"/><file name="Rule.php" hash="2ee2d8879d6ac0be3432e1e5334d77cf"/><file name="Sponsorlog.php" hash="97bde1eef9156b5a20f5f2f92a6fee03"/><file name="Sponsorship.php" hash="2c6d63261112e53a9c442ea3568e2e32"/></dir><file name="AutoBoost.php" hash="5b2527368d08cade3495819a823ff8f7"/><file name="Change.php" hash="c4e3f0cd6077fab4ebc7e078d031fc3d"/><file name="Changestatut.php" hash="21106c8021072b8f8cf8419fec0ad0a9"/><file name="Fidelitylog.php" hash="1644dc508b0a1c4d06397a48509f652c"/><file name="Observer.php" hash="9e42dc3d73eb2e0437e92f61c398ccee"/><file name="Openinviter.php" hash="a9432b08bb82c513c5c3fcadb435b2f2"/><file name="Sponsorlog.php" hash="834b0e8e29eff5061abb18621a22ddb5"/><file name="Sponsorship.php" hash="acd91d3c6a6dbe801e7dde41a8d2fb06"/><file name="Status.php" hash="ad5779cf7a0887635315b74827780063"/><file name="Validator.php" hash="87d39a07bff5133894f8334f9f5fe967"/></dir><dir name="sql"><dir name="sponsorship_setup"><file name="mysql4-install-0.1.0.php" hash="cde2a97370601a046bcc559e22a7cdb8"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="99c4e9b7ab6d3aab2477195310482242"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="08dc31268dcb35b68abbc4c179f7ed03"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="9966b88c1e297dd4cae297859e4034a0"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="0d55e5801c8e4031aeece7787ffc94c1"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="6de811c47e0031c134a8343e230ca451"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="d6f43e969bf07f5859b1f251540c358d"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="5289d74fa889d0046a19d9714df5572b"/><file name="mysql4-upgrade-0.1.7-0.1.8.php" hash="89acdec2f7785fc2e6e82ff6265e439a"/><file name="mysql4-upgrade-0.1.8-0.1.9.php" hash="02158b6524f5d24c8e9d07022da2aa27"/><file name="mysql4-upgrade-0.1.9-0.1.10.php" hash="b29284b6cf0df556810ed3bdb47fd7dc"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="sponsorship_coupon.html" hash="0ca5d0c23070e0a6a9f9822ad9612678"/><file name="sponsorship_invitation.html" hash="30fe91c3b83ee223f6bffb3dd779dd26"/></dir></dir></dir><dir name="fr_FR"><dir name="template"><dir name="email"><file name="sponsorship_coupon.html" hash="bbd873e171d6a9ca5f46e04314c39624"/><file name="sponsorship_invitation.html" hash="30fe91c3b83ee223f6bffb3dd779dd26"/></dir></dir><file name="Auguria_Sponsorship.csv" hash="51a14efba142b3b94a2e0d3117db37c3"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="tableorderer.css" hash="30454132306ff6ac4dcf190aa922b7cc"/></dir><dir name="images"><dir name="tableorderer"><file name="asc.gif" hash="a54846803de3cc786eec3d69f9ac2d38"/><file name="bg.gif" hash="c01ad2e7c59d1a20a433cb873c21bd88"/><file name="bkg_toolbar.gif" hash="fb7ed019476eaa1643af922b59ede4fb"/><file name="desc.gif" hash="f8a1940c9cf44ab8870319169f3a14ff"/></dir></dir></dir></dir></dir></target></contents>
32
  <compatible/>
33
  <dependencies/>
34
  </package>