camping-oauth 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. data/README +3 -0
  2. data/doc/classes/CampingOAuthConsumer.html +145 -0
  3. data/doc/classes/CampingOAuthConsumer.src/M000041.html +19 -0
  4. data/doc/classes/CampingOAuthConsumer/Controllers.html +116 -0
  5. data/doc/classes/CampingOAuthConsumer/Controllers/AccessToken.html +137 -0
  6. data/doc/classes/CampingOAuthConsumer/Controllers/AccessToken.src/M000051.html +32 -0
  7. data/doc/classes/CampingOAuthConsumer/Controllers/AccessTokenAuthorized.html +137 -0
  8. data/doc/classes/CampingOAuthConsumer/Controllers/AccessTokenAuthorized.src/M000050.html +20 -0
  9. data/doc/classes/CampingOAuthConsumer/Controllers/AuthorizeToken.html +137 -0
  10. data/doc/classes/CampingOAuthConsumer/Controllers/AuthorizeToken.src/M000048.html +24 -0
  11. data/doc/classes/CampingOAuthConsumer/Controllers/GetTimeNow.html +137 -0
  12. data/doc/classes/CampingOAuthConsumer/Controllers/GetTimeNow.src/M000049.html +28 -0
  13. data/doc/classes/CampingOAuthConsumer/Controllers/Index.html +137 -0
  14. data/doc/classes/CampingOAuthConsumer/Controllers/Index.src/M000046.html +18 -0
  15. data/doc/classes/CampingOAuthConsumer/Controllers/RequestToken.html +137 -0
  16. data/doc/classes/CampingOAuthConsumer/Controllers/RequestToken.src/M000047.html +24 -0
  17. data/doc/classes/CampingOAuthConsumer/Views.html +176 -0
  18. data/doc/classes/CampingOAuthConsumer/Views.src/M000042.html +42 -0
  19. data/doc/classes/CampingOAuthConsumer/Views.src/M000043.html +41 -0
  20. data/doc/classes/CampingOAuthConsumer/Views.src/M000044.html +18 -0
  21. data/doc/classes/CampingOAuthConsumer/Views.src/M000045.html +19 -0
  22. data/doc/classes/CampingOAuthProvider.html +149 -0
  23. data/doc/classes/CampingOAuthProvider.src/M000052.html +23 -0
  24. data/doc/classes/CampingOAuthProvider/Controllers.html +113 -0
  25. data/doc/classes/CampingOAuthProvider/Controllers/APITimeNow.html +137 -0
  26. data/doc/classes/CampingOAuthProvider/Controllers/APITimeNow.src/M000058.html +23 -0
  27. data/doc/classes/CampingOAuthProvider/Controllers/Index.html +137 -0
  28. data/doc/classes/CampingOAuthProvider/Controllers/Index.src/M000055.html +18 -0
  29. data/doc/classes/CampingOAuthProvider/Controllers/Login.html +152 -0
  30. data/doc/classes/CampingOAuthProvider/Controllers/Login.src/M000056.html +18 -0
  31. data/doc/classes/CampingOAuthProvider/Controllers/Login.src/M000057.html +33 -0
  32. data/doc/classes/CampingOAuthProvider/Helpers.html +112 -0
  33. data/doc/classes/CampingOAuthProvider/Models.html +119 -0
  34. data/doc/classes/CampingOAuthProvider/Models/CreateUserSchema.html +152 -0
  35. data/doc/classes/CampingOAuthProvider/Models/CreateUserSchema.src/M000059.html +26 -0
  36. data/doc/classes/CampingOAuthProvider/Models/CreateUserSchema.src/M000060.html +19 -0
  37. data/doc/classes/CampingOAuthProvider/Models/User.html +111 -0
  38. data/doc/classes/CampingOAuthProvider/Views.html +146 -0
  39. data/doc/classes/CampingOAuthProvider/Views.src/M000053.html +19 -0
  40. data/doc/classes/CampingOAuthProvider/Views.src/M000054.html +27 -0
  41. data/doc/classes/OAuth.html +107 -0
  42. data/doc/classes/OAuth/RequestProxy.html +112 -0
  43. data/doc/classes/OAuth/RequestProxy/Base.html +153 -0
  44. data/doc/classes/OAuth/RequestProxy/Base.src/M000039.html +28 -0
  45. data/doc/classes/OAuth/RequestProxy/Base.src/M000040.html +28 -0
  46. data/doc/classes/OAuth/RequestProxy/RackRequest.html +143 -0
  47. data/doc/classes/OAuth/RequestProxy/RackRequest.src/M000039.html +18 -0
  48. data/doc/classes/OAuthCampingPlugin.html +188 -0
  49. data/doc/classes/OAuthCampingPlugin.src/M000001.html +18 -0
  50. data/doc/classes/OAuthCampingPlugin.src/M000002.html +18 -0
  51. data/doc/classes/OAuthCampingPlugin.src/M000003.html +17 -0
  52. data/doc/classes/OAuthCampingPlugin/Controllers.html +191 -0
  53. data/doc/classes/OAuthCampingPlugin/Controllers.src/M000024.html +18 -0
  54. data/doc/classes/OAuthCampingPlugin/Controllers.src/M000025.html +26 -0
  55. data/doc/classes/OAuthCampingPlugin/Filters.html +161 -0
  56. data/doc/classes/OAuthCampingPlugin/Filters.src/M000034.html +34 -0
  57. data/doc/classes/OAuthCampingPlugin/Helpers.html +283 -0
  58. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000026.html +18 -0
  59. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000027.html +19 -0
  60. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000028.html +20 -0
  61. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000029.html +20 -0
  62. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000030.html +18 -0
  63. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000031.html +18 -0
  64. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000032.html +20 -0
  65. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000033.html +20 -0
  66. data/doc/classes/OAuthCampingPlugin/Models.html +219 -0
  67. data/doc/classes/OAuthCampingPlugin/Models.src/M000035.html +55 -0
  68. data/doc/classes/OAuthCampingPlugin/Models.src/M000036.html +31 -0
  69. data/doc/classes/OAuthCampingPlugin/Models.src/M000037.html +56 -0
  70. data/doc/classes/OAuthCampingPlugin/Models.src/M000038.html +22 -0
  71. data/doc/classes/OAuthCampingPlugin/OAuth.html +407 -0
  72. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000004.html +18 -0
  73. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000005.html +18 -0
  74. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000006.html +20 -0
  75. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000007.html +20 -0
  76. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000008.html +20 -0
  77. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000009.html +24 -0
  78. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000010.html +20 -0
  79. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000011.html +18 -0
  80. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000012.html +19 -0
  81. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000013.html +26 -0
  82. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000014.html +26 -0
  83. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000015.html +33 -0
  84. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000016.html +18 -0
  85. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000017.html +18 -0
  86. data/doc/classes/OAuthCampingPlugin/Views.html +257 -0
  87. data/doc/classes/OAuthCampingPlugin/Views.src/M000018.html +18 -0
  88. data/doc/classes/OAuthCampingPlugin/Views.src/M000019.html +18 -0
  89. data/doc/classes/OAuthCampingPlugin/Views.src/M000020.html +18 -0
  90. data/doc/classes/OAuthCampingPlugin/Views.src/M000021.html +18 -0
  91. data/doc/classes/OAuthCampingPlugin/Views.src/M000022.html +18 -0
  92. data/doc/classes/OAuthCampingPlugin/Views.src/M000023.html +41 -0
  93. data/doc/created.rid +1 -0
  94. data/doc/files/examples/camping-oauth-consumer/camping-oauth-consumer_rb.html +124 -0
  95. data/doc/files/examples/camping-oauth-provider/camping-oauth-provider_rb.html +101 -0
  96. data/doc/files/lib/camping-oauth_rb.html +576 -0
  97. data/doc/fr_class_index.html +56 -0
  98. data/doc/fr_file_index.html +29 -0
  99. data/doc/fr_method_index.html +86 -0
  100. data/doc/index.html +24 -0
  101. data/lib/camping-oauth.rb +1078 -0
  102. metadata +172 -0
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>common_oauth_controllers (OAuthCampingPlugin::Controllers)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 768</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">common_oauth_controllers</span>
15
+ <span class="ruby-value str">&quot;\nclass OAuthRegisterApplication &lt; R '/oauth/register'\ndef get\n@application= ClientApplication.new\nrender :new_application_registration\nend\n\ndef post\n@user = User.find(@state.user_id)\nif !@user\nreturn \&quot;login first\&quot;\nend\n\n@application = ClientApplication.find_by_user_id_and_name(@state.user_id, input.name)\nif @application\n@info = 'You already have an application with this name.'\nelse\n@application = ClientApplication.new :user_id =&gt; @state.user_id,\n:name =&gt; input.name,\n:url =&gt; input.url,\n:support_url =&gt; input.support_url,\n:callback_url =&gt; input.callback_url\n\n@user.client_applications &lt;&lt; @application\n\n@application.save\nif @application\nreturn(render(:application_registration))\nelse\n@info = @application.errors.full_messages unless @application.errors.empty?\nend\nend\n\nrender :new_application_registration\nend\nend\n\nclass OAuthProvideRequestToken &lt; R '/oauth/request_token'\ninclude OAuthCampingPlugin::OAuth\n\ndef post\noauth_consumer_key = oauth_header_params['oauth_consumer_key']\n\n@application = ClientApplication.find_by_key(oauth_consumer_key)\n@token = @application.create_request_token\nlog_debug 'OAuthProvideRequestToken&gt; request token for oauth_consumer_key:' + oauth_consumer_key + '=' + @token.inspect\n@token.to_query\nend\nend\n\nclass OAuthAuthorizeToken &lt; R '/oauth/authorize'\ninclude OAuthCampingPlugin::OAuth\n\ndef get\n@oauth_token = input.oauth_token\nrender :authorize\nend\n\ndef post\n@token = RequestToken.find_by_token input.oauth_token\nreturn(render(:authorize_failure_token_not_found)) if @token.nil?\n\nreturn(render(:authorize_failure_invalidated)) if @token.invalidated?\n\nreturn(render(:authorize_failure)) unless user_authorizes_token?\n\n@token.authorize!(current_user)\nlog_debug 'OAuthAuthorizeToken&gt; request token=' + @token.inspect\n\nif @token.oauth10?\n@redirect_url = input.oauth_callback || @token.client_application.callback_url\nelse\n@redirect_url = (@token.oob? || @token.callback_url.nil?) ? @token.client_application.callback_url : @token.callback_url\nend\n\nreturn(render(:authorize_success)) unless @redirect_url\n\n@full_redirect_url = @token.oauth10? ? (@redirect_url + '?oauth_token=' + @token.token) : (@redirect_url + '?oauth_token=' + @token.token + '&amp;oauth_verifier=' + @token.verifier)\n\nredirect @full_redirect_url\nend\n\n# Override this to match your authorization page form\ndef user_authorizes_token?\ninput.authorize == '1' || input.authorize == 'on'\nend\nend\n\nclass OAuthRevokeToken &lt; R '/oauth/revoke'\ninclude OAuthCampingPlugin::OAuth\n\ndef get\n@token = OauthToken.find_by_token(input.oauth_token)\nreturn(render(:authorize_failure_token_not_found)) if @token.nil?\n\nrender :revoke\nend\n\ndef post\n@token = OauthToken.find_by_token(input.oauth_token)\nreturn(render(:authorize_failure_token_not_found)) if @token.nil?\n\nif input.revoke != 'on'\n@info = \&quot;You did not confirm you wanted to revoke this token. Check the checkbox to confirm.\&quot;\nreturn(render(:revoke))\nend\n\n@token.invalidate!\nlog_debug 'OAuthRevokeToken&gt; access token=' + @token.inspect\n\nrender :revoke_success\nend\nend\n\nclass OAuthProvideAccessToken &lt; R '/oauth/access_token'\ninclude OAuthCampingPlugin::OAuth\n\ndef post\nlog_debug 'OAuthProvideAccessToken&gt; @current_token=' + self.current_token.inspect\n\nreturn(r(401,'')) if self.current_token.nil?\n\n@token = self.current_token.exchange!\nlog_debug 'OAuthProvideAccessToken&gt; access token=' + @token.inspect\n\nreturn(r(401,'')) if self.current_token.nil?\n@token.to_query\n\nend #post\nend\n\n&quot;</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>include_oauth_controllers (OAuthCampingPlugin::Controllers)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 907</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include_oauth_controllers</span>
15
+ <span class="ruby-identifier">module_eval</span> <span class="ruby-constant">OAuthCampingPlugin</span><span class="ruby-operator">::</span><span class="ruby-constant">Controllers</span>.<span class="ruby-identifier">common_oauth_controllers</span>
16
+
17
+ <span class="ruby-comment cmt"># Add Oauth to each controller</span>
18
+ <span class="ruby-identifier">r</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
19
+ <span class="ruby-identifier">x</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span>
20
+ <span class="ruby-identifier">include</span> <span class="ruby-constant">OAuthCampingPlugin</span><span class="ruby-operator">::</span><span class="ruby-constant">OAuth</span>
21
+ <span class="ruby-identifier">include</span> <span class="ruby-constant">OAuthCampingPlugin</span><span class="ruby-operator">::</span><span class="ruby-constant">Helpers</span>
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-keyword kw">end</span></pre>
25
+ </body>
26
+ </html>
@@ -0,0 +1,161 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Module: OAuthCampingPlugin::Filters</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">OAuthCampingPlugin::Filters</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/camping-oauth_rb.html">
59
+ lib/camping-oauth.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+ <div id="description">
76
+ <p>
77
+ <a href="Filters.html">Filters</a> module for <a
78
+ href="OAuth.html">OAuth</a> Camping Plugin. The module will be plugged in
79
+ to the main app <a href="Helpers.html">Helpers</a> module. Example:
80
+ </p>
81
+ <pre>
82
+ module CampingOAuthProvider
83
+ include Camping::Session
84
+ include CampingFilters
85
+ extend OAuthCampingPlugin
86
+ include OAuthCampingPlugin::Filters
87
+
88
+ # ...
89
+ end
90
+ </pre>
91
+
92
+ </div>
93
+
94
+
95
+ </div>
96
+
97
+ <div id="method-list">
98
+ <h3 class="section-bar">Methods</h3>
99
+
100
+ <div class="name-list">
101
+ <a href="#M000034">included</a>&nbsp;&nbsp;
102
+ </div>
103
+ </div>
104
+
105
+ </div>
106
+
107
+
108
+ <!-- if includes -->
109
+
110
+ <div id="section">
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+ <!-- if method_list -->
120
+ <div id="methods">
121
+ <h3 class="section-bar">Public Class methods</h3>
122
+
123
+ <div id="method-M000034" class="method-detail">
124
+ <a name="M000034"></a>
125
+
126
+ <div class="method-heading">
127
+ <a href="Filters.src/M000034.html" target="Code" class="method-signature"
128
+ onclick="popupCode('Filters.src/M000034.html');return false;">
129
+ <span class="method-name">included</span><span class="method-args">(mod)</span>
130
+ </a>
131
+ </div>
132
+
133
+ <div class="method-description">
134
+ <p>
135
+ Adds 3 before filters for the common <a href="OAuth.html">OAuth</a>
136
+ controllers:
137
+ </p>
138
+ <pre>
139
+ - OAuthRegisterApplication
140
+ - OAuthProvideRequestToken
141
+ - OAuthProvideAccessToken
142
+ </pre>
143
+ <p>
144
+ Also adds a before filter on all controllers to ensure the user is set
145
+ </p>
146
+ </div>
147
+ </div>
148
+
149
+
150
+ </div>
151
+
152
+
153
+ </div>
154
+
155
+
156
+ <div id="validator-badges">
157
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
158
+ </div>
159
+
160
+ </body>
161
+ </html>
@@ -0,0 +1,34 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>included (OAuthCampingPlugin::Filters)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 434</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">mod</span>)
15
+ <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">module_eval</span> <span class="ruby-keyword kw">do</span>
16
+ <span class="ruby-identifier">before</span> <span class="ruby-identifier">:all</span> <span class="ruby-keyword kw">do</span>
17
+ <span class="ruby-identifier">set_user</span>
18
+ <span class="ruby-keyword kw">end</span>
19
+
20
+ <span class="ruby-identifier">before</span> <span class="ruby-identifier">:OAuthRegisterApplication</span> <span class="ruby-keyword kw">do</span>
21
+ <span class="ruby-identifier">login_required</span>
22
+ <span class="ruby-keyword kw">end</span>
23
+
24
+ <span class="ruby-identifier">before</span> <span class="ruby-identifier">:OAuthProvideRequestToken</span> <span class="ruby-keyword kw">do</span>
25
+ <span class="ruby-identifier">verify_oauth_consumer_signature</span>
26
+ <span class="ruby-keyword kw">end</span>
27
+
28
+ <span class="ruby-identifier">before</span> <span class="ruby-identifier">:OAuthProvideAccessToken</span> <span class="ruby-keyword kw">do</span>
29
+ <span class="ruby-identifier">verify_oauth_request_token</span>
30
+ <span class="ruby-keyword kw">end</span>
31
+ <span class="ruby-keyword kw">end</span>
32
+ <span class="ruby-keyword kw">end</span></pre>
33
+ </body>
34
+ </html>
@@ -0,0 +1,283 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Module: OAuthCampingPlugin::Helpers</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">OAuthCampingPlugin::Helpers</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/camping-oauth_rb.html">
59
+ lib/camping-oauth.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+ <div id="description">
76
+ <p>
77
+ <a href="Helpers.html">Helpers</a> module for <a
78
+ href="OAuth.html">OAuth</a> Camping Plugin. The module will be plugged in
79
+ to the main app <a href="Helpers.html">Helpers</a> module. Its methods will
80
+ be added to <a href="Controllers.html">Controllers</a> and <a
81
+ href="Views.html">Views</a>. Example:
82
+ </p>
83
+ <pre>
84
+ module CampingOAuthProvider::Helpers
85
+ extend OAuthCampingPlugin::Helpers
86
+ include OAuthCampingPlugin::Helpers
87
+ end
88
+ </pre>
89
+
90
+ </div>
91
+
92
+
93
+ </div>
94
+
95
+ <div id="method-list">
96
+ <h3 class="section-bar">Methods</h3>
97
+
98
+ <div class="name-list">
99
+ <a href="#M000033">access_denied</a>&nbsp;&nbsp;
100
+ <a href="#M000027">app_module</a>&nbsp;&nbsp;
101
+ <a href="#M000031">current_user</a>&nbsp;&nbsp;
102
+ <a href="#M000026">log_debug</a>&nbsp;&nbsp;
103
+ <a href="#M000032">login_required</a>&nbsp;&nbsp;
104
+ <a href="#M000029">nonce_class</a>&nbsp;&nbsp;
105
+ <a href="#M000030">set_user</a>&nbsp;&nbsp;
106
+ <a href="#M000028">user_class</a>&nbsp;&nbsp;
107
+ </div>
108
+ </div>
109
+
110
+ </div>
111
+
112
+
113
+ <!-- if includes -->
114
+
115
+ <div id="section">
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+ <!-- if method_list -->
125
+ <div id="methods">
126
+ <h3 class="section-bar">Public Instance methods</h3>
127
+
128
+ <div id="method-M000033" class="method-detail">
129
+ <a name="M000033"></a>
130
+
131
+ <div class="method-heading">
132
+ <a href="Helpers.src/M000033.html" target="Code" class="method-signature"
133
+ onclick="popupCode('Helpers.src/M000033.html');return false;">
134
+ <span class="method-name">access_denied</span><span class="method-args">()</span>
135
+ </a>
136
+ </div>
137
+
138
+ <div class="method-description">
139
+ <p>
140
+ Redirects to the login page with an access denied error message
141
+ </p>
142
+ </div>
143
+ </div>
144
+
145
+ <div id="method-M000027" class="method-detail">
146
+ <a name="M000027"></a>
147
+
148
+ <div class="method-heading">
149
+ <a href="Helpers.src/M000027.html" target="Code" class="method-signature"
150
+ onclick="popupCode('Helpers.src/M000027.html');return false;">
151
+ <span class="method-name">app_module</span><span class="method-args">()</span>
152
+ </a>
153
+ </div>
154
+
155
+ <div class="method-description">
156
+ <p>
157
+ Reverse engineers the main app module
158
+ </p>
159
+ </div>
160
+ </div>
161
+
162
+ <div id="method-M000031" class="method-detail">
163
+ <a name="M000031"></a>
164
+
165
+ <div class="method-heading">
166
+ <a href="Helpers.src/M000031.html" target="Code" class="method-signature"
167
+ onclick="popupCode('Helpers.src/M000031.html');return false;">
168
+ <span class="method-name">current_user</span><span class="method-args">()</span>
169
+ </a>
170
+ </div>
171
+
172
+ <div class="method-description">
173
+ <p>
174
+ Returns the current user model instance
175
+ </p>
176
+ </div>
177
+ </div>
178
+
179
+ <div id="method-M000026" class="method-detail">
180
+ <a name="M000026"></a>
181
+
182
+ <div class="method-heading">
183
+ <a href="Helpers.src/M000026.html" target="Code" class="method-signature"
184
+ onclick="popupCode('Helpers.src/M000026.html');return false;">
185
+ <span class="method-name">log_debug</span><span class="method-args">(msg)</span>
186
+ </a>
187
+ </div>
188
+
189
+ <div class="method-description">
190
+ <p>
191
+ Logs a specific message if in debug mode
192
+ </p>
193
+ </div>
194
+ </div>
195
+
196
+ <div id="method-M000032" class="method-detail">
197
+ <a name="M000032"></a>
198
+
199
+ <div class="method-heading">
200
+ <a href="Helpers.src/M000032.html" target="Code" class="method-signature"
201
+ onclick="popupCode('Helpers.src/M000032.html');return false;">
202
+ <span class="method-name">login_required</span><span class="method-args">()</span>
203
+ </a>
204
+ </div>
205
+
206
+ <div class="method-description">
207
+ <p>
208
+ Returns whether or not the user is logged in Typically used within a
209
+ controller before filter such as in:
210
+ </p>
211
+ <pre>
212
+ before :OAuthRegisterApplication do
213
+ login_required
214
+ end
215
+ </pre>
216
+ </div>
217
+ </div>
218
+
219
+ <div id="method-M000029" class="method-detail">
220
+ <a name="M000029"></a>
221
+
222
+ <div class="method-heading">
223
+ <a href="Helpers.src/M000029.html" target="Code" class="method-signature"
224
+ onclick="popupCode('Helpers.src/M000029.html');return false;">
225
+ <span class="method-name">nonce_class</span><span class="method-args">()</span>
226
+ </a>
227
+ </div>
228
+
229
+ <div class="method-description">
230
+ <p>
231
+ Reverse engineers the main OauthNonce model class
232
+ </p>
233
+ </div>
234
+ </div>
235
+
236
+ <div id="method-M000030" class="method-detail">
237
+ <a name="M000030"></a>
238
+
239
+ <div class="method-heading">
240
+ <a href="Helpers.src/M000030.html" target="Code" class="method-signature"
241
+ onclick="popupCode('Helpers.src/M000030.html');return false;">
242
+ <span class="method-name">set_user</span><span class="method-args">()</span>
243
+ </a>
244
+ </div>
245
+
246
+ <div class="method-description">
247
+ <p>
248
+ Looks up the user based on saved state (if any) and assigns it to the @user
249
+ variable
250
+ </p>
251
+ </div>
252
+ </div>
253
+
254
+ <div id="method-M000028" class="method-detail">
255
+ <a name="M000028"></a>
256
+
257
+ <div class="method-heading">
258
+ <a href="Helpers.src/M000028.html" target="Code" class="method-signature"
259
+ onclick="popupCode('Helpers.src/M000028.html');return false;">
260
+ <span class="method-name">user_class</span><span class="method-args">()</span>
261
+ </a>
262
+ </div>
263
+
264
+ <div class="method-description">
265
+ <p>
266
+ Reverse engineers the main User model class
267
+ </p>
268
+ </div>
269
+ </div>
270
+
271
+
272
+ </div>
273
+
274
+
275
+ </div>
276
+
277
+
278
+ <div id="validator-badges">
279
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
280
+ </div>
281
+
282
+ </body>
283
+ </html>