annotate vendor/plugins/embedded/test/fixtures/html/app-controllers-account_controller_rb.html @ 242:bde4f47b6427 feature_73

Do more-or-less the right thing to pull in and update external repos
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 24 Feb 2011 15:04:51 +0000
parents 317821dd92c9
children
rev   line source
Chris@154 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Chris@154 2 <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'><head><title>app/controllers/account_controller.rb - C0 code coverage information</title>
Chris@154 3 <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style>
Chris@154 4 <style type='text/css'>span.cross-ref-title {
Chris@154 5 font-size: 140%;
Chris@154 6 }
Chris@154 7 span.cross-ref a {
Chris@154 8 text-decoration: none;
Chris@154 9 }
Chris@154 10 span.cross-ref {
Chris@154 11 background-color:#f3f7fa;
Chris@154 12 border: 1px dashed #333;
Chris@154 13 margin: 1em;
Chris@154 14 padding: 0.5em;
Chris@154 15 overflow: hidden;
Chris@154 16 }
Chris@154 17 a.crossref-toggle {
Chris@154 18 text-decoration: none;
Chris@154 19 }
Chris@154 20 span.marked0 {
Chris@154 21 background-color: rgb(185, 210, 200);
Chris@154 22 display: block;
Chris@154 23 }
Chris@154 24 span.marked1 {
Chris@154 25 background-color: rgb(190, 215, 205);
Chris@154 26 display: block;
Chris@154 27 }
Chris@154 28 span.inferred0 {
Chris@154 29 background-color: rgb(175, 200, 200);
Chris@154 30 display: block;
Chris@154 31 }
Chris@154 32 span.inferred1 {
Chris@154 33 background-color: rgb(180, 205, 205);
Chris@154 34 display: block;
Chris@154 35 }
Chris@154 36 span.uncovered0 {
Chris@154 37 background-color: rgb(225, 110, 110);
Chris@154 38 display: block;
Chris@154 39 }
Chris@154 40 span.uncovered1 {
Chris@154 41 background-color: rgb(235, 120, 120);
Chris@154 42 display: block;
Chris@154 43 }
Chris@154 44 span.overview {
Chris@154 45 border-bottom: 8px solid black;
Chris@154 46 }
Chris@154 47 div.overview {
Chris@154 48 border-bottom: 8px solid black;
Chris@154 49 }
Chris@154 50 body {
Chris@154 51 font-family: verdana, arial, helvetica;
Chris@154 52 }
Chris@154 53 div.footer {
Chris@154 54 font-size: 68%;
Chris@154 55 margin-top: 1.5em;
Chris@154 56 }
Chris@154 57 h1, h2, h3, h4, h5, h6 {
Chris@154 58 margin-bottom: 0.5em;
Chris@154 59 }
Chris@154 60 h5 {
Chris@154 61 margin-top: 0.5em;
Chris@154 62 }
Chris@154 63 .hidden {
Chris@154 64 display: none;
Chris@154 65 }
Chris@154 66 div.separator {
Chris@154 67 height: 10px;
Chris@154 68 }
Chris@154 69 /* Commented out for better readability, esp. on IE */
Chris@154 70 /*
Chris@154 71 table tr td, table tr th {
Chris@154 72 font-size: 68%;
Chris@154 73 }
Chris@154 74 td.value table tr td {
Chris@154 75 font-size: 11px;
Chris@154 76 }
Chris@154 77 */
Chris@154 78 table.percent_graph {
Chris@154 79 height: 12px;
Chris@154 80 border: #808080 1px solid;
Chris@154 81 empty-cells: show;
Chris@154 82 }
Chris@154 83 table.percent_graph td.covered {
Chris@154 84 height: 10px;
Chris@154 85 background: #00f000;
Chris@154 86 }
Chris@154 87 table.percent_graph td.uncovered {
Chris@154 88 height: 10px;
Chris@154 89 background: #e00000;
Chris@154 90 }
Chris@154 91 table.percent_graph td.NA {
Chris@154 92 height: 10px;
Chris@154 93 background: #eaeaea;
Chris@154 94 }
Chris@154 95 table.report {
Chris@154 96 border-collapse: collapse;
Chris@154 97 width: 100%;
Chris@154 98 }
Chris@154 99 table.report td.heading {
Chris@154 100 background: #dcecff;
Chris@154 101 border: #d0d0d0 1px solid;
Chris@154 102 font-weight: bold;
Chris@154 103 text-align: center;
Chris@154 104 }
Chris@154 105 table.report td.heading:hover {
Chris@154 106 background: #c0ffc0;
Chris@154 107 }
Chris@154 108 table.report td.text {
Chris@154 109 border: #d0d0d0 1px solid;
Chris@154 110 }
Chris@154 111 table.report td.value,
Chris@154 112 table.report td.lines_total,
Chris@154 113 table.report td.lines_code {
Chris@154 114 text-align: right;
Chris@154 115 border: #d0d0d0 1px solid;
Chris@154 116 }
Chris@154 117 table.report tr.light {
Chris@154 118 background-color: rgb(240, 240, 245);
Chris@154 119 }
Chris@154 120 table.report tr.dark {
Chris@154 121 background-color: rgb(230, 230, 235);
Chris@154 122 }
Chris@154 123 </style>
Chris@154 124 <script type='text/javascript'>
Chris@154 125 // <![CDATA[
Chris@154 126 function toggleCode( id ) {
Chris@154 127 if ( document.getElementById )
Chris@154 128 elem = document.getElementById( id );
Chris@154 129 else if ( document.all )
Chris@154 130 elem = eval( "document.all." + id );
Chris@154 131 else
Chris@154 132 return false;
Chris@154 133
Chris@154 134 elemStyle = elem.style;
Chris@154 135
Chris@154 136 if ( elemStyle.display != "block" ) {
Chris@154 137 elemStyle.display = "block"
Chris@154 138 } else {
Chris@154 139 elemStyle.display = "none"
Chris@154 140 }
Chris@154 141
Chris@154 142 return true;
Chris@154 143 }
Chris@154 144
Chris@154 145 // Make cross-references hidden by default
Chris@154 146 document.writeln( "<style type=\"text/css\">span.cross-ref { display: none }</style>" )
Chris@154 147 // ]]>
Chris@154 148 </script>
Chris@154 149 <style type='text/css'>span.run0 {
Chris@154 150 background-color: rgb(178, 204, 255);
Chris@154 151 display: block;
Chris@154 152 }
Chris@154 153 span.run1 {
Chris@154 154 background-color: rgb(178, 206, 255);
Chris@154 155 display: block;
Chris@154 156 }
Chris@154 157 span.run2 {
Chris@154 158 background-color: rgb(178, 209, 255);
Chris@154 159 display: block;
Chris@154 160 }
Chris@154 161 span.run3 {
Chris@154 162 background-color: rgb(178, 211, 255);
Chris@154 163 display: block;
Chris@154 164 }
Chris@154 165 span.run4 {
Chris@154 166 background-color: rgb(178, 214, 255);
Chris@154 167 display: block;
Chris@154 168 }
Chris@154 169 span.run5 {
Chris@154 170 background-color: rgb(178, 218, 255);
Chris@154 171 display: block;
Chris@154 172 }
Chris@154 173 span.run6 {
Chris@154 174 background-color: rgb(178, 220, 255);
Chris@154 175 display: block;
Chris@154 176 }
Chris@154 177 span.run7 {
Chris@154 178 background-color: rgb(178, 223, 255);
Chris@154 179 display: block;
Chris@154 180 }
Chris@154 181 span.run8 {
Chris@154 182 background-color: rgb(178, 225, 255);
Chris@154 183 display: block;
Chris@154 184 }
Chris@154 185 span.run9 {
Chris@154 186 background-color: rgb(178, 228, 255);
Chris@154 187 display: block;
Chris@154 188 }
Chris@154 189 span.run10 {
Chris@154 190 background-color: rgb(178, 232, 255);
Chris@154 191 display: block;
Chris@154 192 }
Chris@154 193 span.run11 {
Chris@154 194 background-color: rgb(178, 234, 255);
Chris@154 195 display: block;
Chris@154 196 }
Chris@154 197 span.run12 {
Chris@154 198 background-color: rgb(178, 237, 255);
Chris@154 199 display: block;
Chris@154 200 }
Chris@154 201 span.run13 {
Chris@154 202 background-color: rgb(178, 239, 255);
Chris@154 203 display: block;
Chris@154 204 }
Chris@154 205 span.run14 {
Chris@154 206 background-color: rgb(178, 242, 255);
Chris@154 207 display: block;
Chris@154 208 }
Chris@154 209 span.run15 {
Chris@154 210 background-color: rgb(178, 246, 255);
Chris@154 211 display: block;
Chris@154 212 }
Chris@154 213 span.run16 {
Chris@154 214 background-color: rgb(178, 248, 255);
Chris@154 215 display: block;
Chris@154 216 }
Chris@154 217 span.run17 {
Chris@154 218 background-color: rgb(178, 251, 255);
Chris@154 219 display: block;
Chris@154 220 }
Chris@154 221 span.run18 {
Chris@154 222 background-color: rgb(178, 253, 255);
Chris@154 223 display: block;
Chris@154 224 }
Chris@154 225 span.run19 {
Chris@154 226 background-color: rgb(178, 255, 253);
Chris@154 227 display: block;
Chris@154 228 }
Chris@154 229 span.run20 {
Chris@154 230 background-color: rgb(178, 255, 249);
Chris@154 231 display: block;
Chris@154 232 }
Chris@154 233 span.run21 {
Chris@154 234 background-color: rgb(178, 255, 247);
Chris@154 235 display: block;
Chris@154 236 }
Chris@154 237 span.run22 {
Chris@154 238 background-color: rgb(178, 255, 244);
Chris@154 239 display: block;
Chris@154 240 }
Chris@154 241 span.run23 {
Chris@154 242 background-color: rgb(178, 255, 242);
Chris@154 243 display: block;
Chris@154 244 }
Chris@154 245 span.run24 {
Chris@154 246 background-color: rgb(178, 255, 239);
Chris@154 247 display: block;
Chris@154 248 }
Chris@154 249 span.run25 {
Chris@154 250 background-color: rgb(178, 255, 235);
Chris@154 251 display: block;
Chris@154 252 }
Chris@154 253 span.run26 {
Chris@154 254 background-color: rgb(178, 255, 233);
Chris@154 255 display: block;
Chris@154 256 }
Chris@154 257 span.run27 {
Chris@154 258 background-color: rgb(178, 255, 230);
Chris@154 259 display: block;
Chris@154 260 }
Chris@154 261 span.run28 {
Chris@154 262 background-color: rgb(178, 255, 228);
Chris@154 263 display: block;
Chris@154 264 }
Chris@154 265 span.run29 {
Chris@154 266 background-color: rgb(178, 255, 225);
Chris@154 267 display: block;
Chris@154 268 }
Chris@154 269 span.run30 {
Chris@154 270 background-color: rgb(178, 255, 221);
Chris@154 271 display: block;
Chris@154 272 }
Chris@154 273 span.run31 {
Chris@154 274 background-color: rgb(178, 255, 219);
Chris@154 275 display: block;
Chris@154 276 }
Chris@154 277 span.run32 {
Chris@154 278 background-color: rgb(178, 255, 216);
Chris@154 279 display: block;
Chris@154 280 }
Chris@154 281 span.run33 {
Chris@154 282 background-color: rgb(178, 255, 214);
Chris@154 283 display: block;
Chris@154 284 }
Chris@154 285 span.run34 {
Chris@154 286 background-color: rgb(178, 255, 211);
Chris@154 287 display: block;
Chris@154 288 }
Chris@154 289 span.run35 {
Chris@154 290 background-color: rgb(178, 255, 207);
Chris@154 291 display: block;
Chris@154 292 }
Chris@154 293 span.run36 {
Chris@154 294 background-color: rgb(178, 255, 205);
Chris@154 295 display: block;
Chris@154 296 }
Chris@154 297 span.run37 {
Chris@154 298 background-color: rgb(178, 255, 202);
Chris@154 299 display: block;
Chris@154 300 }
Chris@154 301 span.run38 {
Chris@154 302 background-color: rgb(178, 255, 200);
Chris@154 303 display: block;
Chris@154 304 }
Chris@154 305 span.run39 {
Chris@154 306 background-color: rgb(178, 255, 197);
Chris@154 307 display: block;
Chris@154 308 }
Chris@154 309 span.run40 {
Chris@154 310 background-color: rgb(178, 255, 193);
Chris@154 311 display: block;
Chris@154 312 }
Chris@154 313 span.run41 {
Chris@154 314 background-color: rgb(178, 255, 191);
Chris@154 315 display: block;
Chris@154 316 }
Chris@154 317 span.run42 {
Chris@154 318 background-color: rgb(178, 255, 188);
Chris@154 319 display: block;
Chris@154 320 }
Chris@154 321 span.run43 {
Chris@154 322 background-color: rgb(178, 255, 186);
Chris@154 323 display: block;
Chris@154 324 }
Chris@154 325 span.run44 {
Chris@154 326 background-color: rgb(178, 255, 183);
Chris@154 327 display: block;
Chris@154 328 }
Chris@154 329 span.run45 {
Chris@154 330 background-color: rgb(178, 255, 179);
Chris@154 331 display: block;
Chris@154 332 }
Chris@154 333 span.run46 {
Chris@154 334 background-color: rgb(179, 255, 178);
Chris@154 335 display: block;
Chris@154 336 }
Chris@154 337 span.run47 {
Chris@154 338 background-color: rgb(182, 255, 178);
Chris@154 339 display: block;
Chris@154 340 }
Chris@154 341 span.run48 {
Chris@154 342 background-color: rgb(184, 255, 178);
Chris@154 343 display: block;
Chris@154 344 }
Chris@154 345 span.run49 {
Chris@154 346 background-color: rgb(187, 255, 178);
Chris@154 347 display: block;
Chris@154 348 }
Chris@154 349 span.run50 {
Chris@154 350 background-color: rgb(191, 255, 178);
Chris@154 351 display: block;
Chris@154 352 }
Chris@154 353 span.run51 {
Chris@154 354 background-color: rgb(193, 255, 178);
Chris@154 355 display: block;
Chris@154 356 }
Chris@154 357 span.run52 {
Chris@154 358 background-color: rgb(196, 255, 178);
Chris@154 359 display: block;
Chris@154 360 }
Chris@154 361 span.run53 {
Chris@154 362 background-color: rgb(198, 255, 178);
Chris@154 363 display: block;
Chris@154 364 }
Chris@154 365 span.run54 {
Chris@154 366 background-color: rgb(201, 255, 178);
Chris@154 367 display: block;
Chris@154 368 }
Chris@154 369 span.run55 {
Chris@154 370 background-color: rgb(205, 255, 178);
Chris@154 371 display: block;
Chris@154 372 }
Chris@154 373 span.run56 {
Chris@154 374 background-color: rgb(207, 255, 178);
Chris@154 375 display: block;
Chris@154 376 }
Chris@154 377 span.run57 {
Chris@154 378 background-color: rgb(210, 255, 178);
Chris@154 379 display: block;
Chris@154 380 }
Chris@154 381 span.run58 {
Chris@154 382 background-color: rgb(212, 255, 178);
Chris@154 383 display: block;
Chris@154 384 }
Chris@154 385 span.run59 {
Chris@154 386 background-color: rgb(215, 255, 178);
Chris@154 387 display: block;
Chris@154 388 }
Chris@154 389 span.run60 {
Chris@154 390 background-color: rgb(219, 255, 178);
Chris@154 391 display: block;
Chris@154 392 }
Chris@154 393 span.run61 {
Chris@154 394 background-color: rgb(221, 255, 178);
Chris@154 395 display: block;
Chris@154 396 }
Chris@154 397 span.run62 {
Chris@154 398 background-color: rgb(224, 255, 178);
Chris@154 399 display: block;
Chris@154 400 }
Chris@154 401 span.run63 {
Chris@154 402 background-color: rgb(226, 255, 178);
Chris@154 403 display: block;
Chris@154 404 }
Chris@154 405 span.run64 {
Chris@154 406 background-color: rgb(229, 255, 178);
Chris@154 407 display: block;
Chris@154 408 }
Chris@154 409 span.run65 {
Chris@154 410 background-color: rgb(233, 255, 178);
Chris@154 411 display: block;
Chris@154 412 }
Chris@154 413 span.run66 {
Chris@154 414 background-color: rgb(235, 255, 178);
Chris@154 415 display: block;
Chris@154 416 }
Chris@154 417 span.run67 {
Chris@154 418 background-color: rgb(238, 255, 178);
Chris@154 419 display: block;
Chris@154 420 }
Chris@154 421 span.run68 {
Chris@154 422 background-color: rgb(240, 255, 178);
Chris@154 423 display: block;
Chris@154 424 }
Chris@154 425 span.run69 {
Chris@154 426 background-color: rgb(243, 255, 178);
Chris@154 427 display: block;
Chris@154 428 }
Chris@154 429 span.run70 {
Chris@154 430 background-color: rgb(247, 255, 178);
Chris@154 431 display: block;
Chris@154 432 }
Chris@154 433 span.run71 {
Chris@154 434 background-color: rgb(249, 255, 178);
Chris@154 435 display: block;
Chris@154 436 }
Chris@154 437 span.run72 {
Chris@154 438 background-color: rgb(252, 255, 178);
Chris@154 439 display: block;
Chris@154 440 }
Chris@154 441 span.run73 {
Chris@154 442 background-color: rgb(255, 255, 178);
Chris@154 443 display: block;
Chris@154 444 }
Chris@154 445 span.run74 {
Chris@154 446 background-color: rgb(255, 252, 178);
Chris@154 447 display: block;
Chris@154 448 }
Chris@154 449 span.run75 {
Chris@154 450 background-color: rgb(255, 248, 178);
Chris@154 451 display: block;
Chris@154 452 }
Chris@154 453 span.run76 {
Chris@154 454 background-color: rgb(255, 246, 178);
Chris@154 455 display: block;
Chris@154 456 }
Chris@154 457 span.run77 {
Chris@154 458 background-color: rgb(255, 243, 178);
Chris@154 459 display: block;
Chris@154 460 }
Chris@154 461 span.run78 {
Chris@154 462 background-color: rgb(255, 240, 178);
Chris@154 463 display: block;
Chris@154 464 }
Chris@154 465 span.run79 {
Chris@154 466 background-color: rgb(255, 238, 178);
Chris@154 467 display: block;
Chris@154 468 }
Chris@154 469 span.run80 {
Chris@154 470 background-color: rgb(255, 234, 178);
Chris@154 471 display: block;
Chris@154 472 }
Chris@154 473 span.run81 {
Chris@154 474 background-color: rgb(255, 232, 178);
Chris@154 475 display: block;
Chris@154 476 }
Chris@154 477 span.run82 {
Chris@154 478 background-color: rgb(255, 229, 178);
Chris@154 479 display: block;
Chris@154 480 }
Chris@154 481 span.run83 {
Chris@154 482 background-color: rgb(255, 226, 178);
Chris@154 483 display: block;
Chris@154 484 }
Chris@154 485 span.run84 {
Chris@154 486 background-color: rgb(255, 224, 178);
Chris@154 487 display: block;
Chris@154 488 }
Chris@154 489 span.run85 {
Chris@154 490 background-color: rgb(255, 220, 178);
Chris@154 491 display: block;
Chris@154 492 }
Chris@154 493 span.run86 {
Chris@154 494 background-color: rgb(255, 218, 178);
Chris@154 495 display: block;
Chris@154 496 }
Chris@154 497 span.run87 {
Chris@154 498 background-color: rgb(255, 215, 178);
Chris@154 499 display: block;
Chris@154 500 }
Chris@154 501 span.run88 {
Chris@154 502 background-color: rgb(255, 212, 178);
Chris@154 503 display: block;
Chris@154 504 }
Chris@154 505 span.run89 {
Chris@154 506 background-color: rgb(255, 210, 178);
Chris@154 507 display: block;
Chris@154 508 }
Chris@154 509 span.run90 {
Chris@154 510 background-color: rgb(255, 206, 178);
Chris@154 511 display: block;
Chris@154 512 }
Chris@154 513 span.run91 {
Chris@154 514 background-color: rgb(255, 204, 178);
Chris@154 515 display: block;
Chris@154 516 }
Chris@154 517 span.run92 {
Chris@154 518 background-color: rgb(255, 201, 178);
Chris@154 519 display: block;
Chris@154 520 }
Chris@154 521 span.run93 {
Chris@154 522 background-color: rgb(255, 198, 178);
Chris@154 523 display: block;
Chris@154 524 }
Chris@154 525 span.run94 {
Chris@154 526 background-color: rgb(255, 196, 178);
Chris@154 527 display: block;
Chris@154 528 }
Chris@154 529 span.run95 {
Chris@154 530 background-color: rgb(255, 192, 178);
Chris@154 531 display: block;
Chris@154 532 }
Chris@154 533 span.run96 {
Chris@154 534 background-color: rgb(255, 189, 178);
Chris@154 535 display: block;
Chris@154 536 }
Chris@154 537 span.run97 {
Chris@154 538 background-color: rgb(255, 187, 178);
Chris@154 539 display: block;
Chris@154 540 }
Chris@154 541 span.run98 {
Chris@154 542 background-color: rgb(255, 184, 178);
Chris@154 543 display: block;
Chris@154 544 }
Chris@154 545 span.run99 {
Chris@154 546 background-color: rgb(255, 182, 178);
Chris@154 547 display: block;
Chris@154 548 }
Chris@154 549 span.run100 {
Chris@154 550 background-color: rgb(255, 178, 178);
Chris@154 551 display: block;
Chris@154 552 }
Chris@154 553 </style>
Chris@154 554 </head>
Chris@154 555 <body><h3>C0 code coverage information</h3>
Chris@154 556 <p>Generated on Tue Jun 24 21:43:53 +0200 2008 with <a href='http://eigenclass.org/hiki/rcov'>rcov 0.8.1.2</a>
Chris@154 557 </p>
Chris@154 558 <hr/>
Chris@154 559 <pre><span class='marked0'>Code reported as executed by Ruby looks like this...
Chris@154 560 </span><span class='marked1'>and this: this line is also marked as covered.
Chris@154 561 </span><span class='inferred0'>Lines considered as run by rcov, but not reported by Ruby, look like this,
Chris@154 562 </span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).
Chris@154 563 </span><span class='uncovered0'>Finally, here&apos;s a line marked as not executed.
Chris@154 564 </span></pre>
Chris@154 565 <table class='report'><thead><tr><td class='heading'>Name</td>
Chris@154 566 <td class='heading'>Total lines</td>
Chris@154 567 <td class='heading'>Lines of code</td>
Chris@154 568 <td class='heading'>Total coverage</td>
Chris@154 569 <td class='heading'>Code coverage</td>
Chris@154 570 </tr>
Chris@154 571 </thead>
Chris@154 572 <tbody><tr class='light'><td><a href='app-controllers-account_controller_rb.html'>app/controllers/account_controller.rb</a>
Chris@154 573 </td>
Chris@154 574 <td class='lines_total'><tt>173</tt>
Chris@154 575 </td>
Chris@154 576 <td class='lines_code'><tt>129</tt>
Chris@154 577 </td>
Chris@154 578 <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>98.8%</tt>
Chris@154 579 &nbsp;</td>
Chris@154 580 <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='99'/>
Chris@154 581 <td class='uncovered' width='1'/>
Chris@154 582 </tr>
Chris@154 583 </table>
Chris@154 584 </td>
Chris@154 585 </tr>
Chris@154 586 </table>
Chris@154 587 </td>
Chris@154 588 <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>98.4%</tt>
Chris@154 589 &nbsp;</td>
Chris@154 590 <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='98'/>
Chris@154 591 <td class='uncovered' width='2'/>
Chris@154 592 </tr>
Chris@154 593 </table>
Chris@154 594 </td>
Chris@154 595 </tr>
Chris@154 596 </table>
Chris@154 597 </td>
Chris@154 598 </tr>
Chris@154 599 </tbody>
Chris@154 600 </table>
Chris@154 601 <pre><span class="inferred0"><a name="line1"></a> 1 # redMine - project management software
Chris@154 602 </span><span class="inferred1"><a name="line2"></a> 2 # Copyright (C) 2006-2007 Jean-Philippe Lang
Chris@154 603 </span><span class="inferred0"><a name="line3"></a> 3 #
Chris@154 604 </span><span class="inferred1"><a name="line4"></a> 4 # This program is free software; you can redistribute it and/or
Chris@154 605 </span><span class="inferred0"><a name="line5"></a> 5 # modify it under the terms of the GNU General Public License
Chris@154 606 </span><span class="inferred1"><a name="line6"></a> 6 # as published by the Free Software Foundation; either version 2
Chris@154 607 </span><span class="inferred0"><a name="line7"></a> 7 # of the License, or (at your option) any later version.
Chris@154 608 </span><span class="inferred1"><a name="line8"></a> 8 #
Chris@154 609 </span><span class="inferred0"><a name="line9"></a> 9 # This program is distributed in the hope that it will be useful,
Chris@154 610 </span><span class="inferred1"><a name="line10"></a> 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@154 611 </span><span class="inferred0"><a name="line11"></a> 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@154 612 </span><span class="inferred1"><a name="line12"></a> 12 # GNU General Public License for more details.
Chris@154 613 </span><span class="inferred0"><a name="line13"></a> 13 #
Chris@154 614 </span><span class="inferred1"><a name="line14"></a> 14 # You should have received a copy of the GNU General Public License
Chris@154 615 </span><span class="inferred0"><a name="line15"></a> 15 # along with this program; if not, write to the Free Software
Chris@154 616 </span><span class="inferred1"><a name="line16"></a> 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Chris@154 617 </span><span class="inferred0"><a name="line17"></a> 17
Chris@154 618 </span><span class="marked1"><a name="line18"></a> 18 class AccountController &lt; ApplicationController
Chris@154 619 </span><span class="marked0"><a name="line19"></a> 19 layout 'base'
Chris@154 620 </span><span class="marked1"><a name="line20"></a> 20 helper :custom_fields
Chris@154 621 </span><span class="marked0"><a name="line21"></a> 21 include CustomFieldsHelper
Chris@154 622 </span><span class="inferred1"><a name="line22"></a> 22
Chris@154 623 </span><span class="inferred0"><a name="line23"></a> 23 # prevents login action to be filtered by check_if_login_required application scope filter
Chris@154 624 </span><span class="marked1"><a name="line24"></a> 24 skip_before_filter :check_if_login_required, :only =&gt; [:login, :lost_password, :register, :activate]
Chris@154 625 </span><span class="inferred0"><a name="line25"></a> 25
Chris@154 626 </span><span class="inferred1"><a name="line26"></a> 26 # Show user's account
Chris@154 627 </span><span class="marked0"><a name="line27"></a> 27 def show
Chris@154 628 </span><span class="marked1"><a name="line28"></a> 28 @user = User.find_active(params[:id])
Chris@154 629 </span><span class="marked0"><a name="line29"></a> 29 @custom_values = @user.custom_values.find(:all, :include =&gt; :custom_field)
Chris@154 630 </span><span class="inferred1"><a name="line30"></a> 30
Chris@154 631 </span><span class="inferred0"><a name="line31"></a> 31 # show only public projects and private projects that the logged in user is also a member of
Chris@154 632 </span><span class="marked1"><a name="line32"></a> 32 @memberships = @user.memberships.select do |membership|
Chris@154 633 </span><span class="marked0"><a name="line33"></a> 33 membership.project.is_public? || (User.current.member_of?(membership.project))
Chris@154 634 </span><span class="inferred1"><a name="line34"></a> 34 end
Chris@154 635 </span><span class="inferred0"><a name="line35"></a> 35 rescue ActiveRecord::RecordNotFound
Chris@154 636 </span><span class="marked1"><a name="line36"></a> 36 render_404
Chris@154 637 </span><span class="marked0"><a name="line37"></a> 37 end
Chris@154 638 </span><span class="inferred1"><a name="line38"></a> 38
Chris@154 639 </span><span class="inferred0"><a name="line39"></a> 39 # Login request and validation
Chris@154 640 </span><span class="marked1"><a name="line40"></a> 40 def login
Chris@154 641 </span><span class="marked0"><a name="line41"></a> 41 if request.get?
Chris@154 642 </span><span class="inferred1"><a name="line42"></a> 42 # Logout user
Chris@154 643 </span><span class="marked0"><a name="line43"></a> 43 self.logged_user = nil
Chris@154 644 </span><span class="inferred1"><a name="line44"></a> 44 else
Chris@154 645 </span><span class="inferred0"><a name="line45"></a> 45 # Authenticate user
Chris@154 646 </span><span class="marked1"><a name="line46"></a> 46 user = User.try_to_login(params[:username], params[:password])
Chris@154 647 </span><span class="marked0"><a name="line47"></a> 47 if user
Chris@154 648 </span><span class="marked1"><a name="line48"></a> 48 self.logged_user = user
Chris@154 649 </span><span class="inferred0"><a name="line49"></a> 49 # generate a key and set cookie if autologin
Chris@154 650 </span><span class="marked1"><a name="line50"></a> 50 if params[:autologin] &amp;&amp; Setting.autologin?
Chris@154 651 </span><span class="marked0"><a name="line51"></a> 51 token = Token.create(:user =&gt; user, :action =&gt; 'autologin')
Chris@154 652 </span><span class="marked1"><a name="line52"></a> 52 cookies[:autologin] = { :value =&gt; token.value, :expires =&gt; 1.year.from_now }
Chris@154 653 </span><span class="inferred0"><a name="line53"></a> 53 end
Chris@154 654 </span><span class="marked1"><a name="line54"></a> 54 redirect_back_or_default :controller =&gt; 'my', :action =&gt; 'page'
Chris@154 655 </span><span class="inferred0"><a name="line55"></a> 55 else
Chris@154 656 </span><span class="marked1"><a name="line56"></a> 56 flash.now[:error] = l(:notice_account_invalid_creditentials)
Chris@154 657 </span><span class="inferred0"><a name="line57"></a> 57 end
Chris@154 658 </span><span class="inferred1"><a name="line58"></a> 58 end
Chris@154 659 </span><span class="uncovered0"><a name="line59"></a> 59 rescue User::OnTheFlyCreationFailure
Chris@154 660 </span><span class="uncovered1"><a name="line60"></a> 60 flash.now[:error] = 'Redmine could not retrieve the required information from the LDAP to create your account. Please, contact your Redmine administrator.'
Chris@154 661 </span><span class="marked0"><a name="line61"></a> 61 end
Chris@154 662 </span><span class="inferred1"><a name="line62"></a> 62
Chris@154 663 </span><span class="inferred0"><a name="line63"></a> 63 # Log out current user and redirect to welcome page
Chris@154 664 </span><span class="marked1"><a name="line64"></a> 64 def logout
Chris@154 665 </span><span class="marked0"><a name="line65"></a> 65 cookies.delete :autologin
Chris@154 666 </span><span class="marked1"><a name="line66"></a> 66 Token.delete_all([&quot;user_id = ? AND action = ?&quot;, User.current.id, 'autologin']) if User.current.logged?
Chris@154 667 </span><span class="marked0"><a name="line67"></a> 67 self.logged_user = nil
Chris@154 668 </span><span class="marked1"><a name="line68"></a> 68 redirect_to home_url
Chris@154 669 </span><span class="inferred0"><a name="line69"></a> 69 end
Chris@154 670 </span><span class="inferred1"><a name="line70"></a> 70
Chris@154 671 </span><span class="inferred0"><a name="line71"></a> 71 # Enable user to choose a new password
Chris@154 672 </span><span class="marked1"><a name="line72"></a> 72 def lost_password
Chris@154 673 </span><span class="marked0"><a name="line73"></a> 73 redirect_to(home_url) &amp;&amp; return unless Setting.lost_password?
Chris@154 674 </span><span class="marked1"><a name="line74"></a> 74 if params[:token]
Chris@154 675 </span><span class="marked0"><a name="line75"></a> 75 @token = Token.find_by_action_and_value(&quot;recovery&quot;, params[:token])
Chris@154 676 </span><span class="marked1"><a name="line76"></a> 76 redirect_to(home_url) &amp;&amp; return unless @token and !@token.expired?
Chris@154 677 </span><span class="marked0"><a name="line77"></a> 77 @user = @token.user
Chris@154 678 </span><span class="marked1"><a name="line78"></a> 78 if request.post?
Chris@154 679 </span><span class="marked0"><a name="line79"></a> 79 @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
Chris@154 680 </span><span class="marked1"><a name="line80"></a> 80 if @user.save
Chris@154 681 </span><span class="marked0"><a name="line81"></a> 81 @token.destroy
Chris@154 682 </span><span class="marked1"><a name="line82"></a> 82 flash[:notice] = l(:notice_account_password_updated)
Chris@154 683 </span><span class="marked0"><a name="line83"></a> 83 redirect_to :action =&gt; 'login'
Chris@154 684 </span><span class="marked1"><a name="line84"></a> 84 return
Chris@154 685 </span><span class="inferred0"><a name="line85"></a> 85 end
Chris@154 686 </span><span class="inferred1"><a name="line86"></a> 86 end
Chris@154 687 </span><span class="marked0"><a name="line87"></a> 87 render :template =&gt; &quot;account/password_recovery&quot;
Chris@154 688 </span><span class="marked1"><a name="line88"></a> 88 return
Chris@154 689 </span><span class="inferred0"><a name="line89"></a> 89 else
Chris@154 690 </span><span class="marked1"><a name="line90"></a> 90 if request.post?
Chris@154 691 </span><span class="marked0"><a name="line91"></a> 91 user = User.find_by_mail(params[:mail])
Chris@154 692 </span><span class="inferred1"><a name="line92"></a> 92 # user not found in db
Chris@154 693 </span><span class="marked0"><a name="line93"></a> 93 flash.now[:error] = l(:notice_account_unknown_email) and return unless user
Chris@154 694 </span><span class="inferred1"><a name="line94"></a> 94 # user uses an external authentification
Chris@154 695 </span><span class="marked0"><a name="line95"></a> 95 flash.now[:error] = l(:notice_can_t_change_password) and return if user.auth_source_id
Chris@154 696 </span><span class="inferred1"><a name="line96"></a> 96 # create a new token for password recovery
Chris@154 697 </span><span class="marked0"><a name="line97"></a> 97 token = Token.new(:user =&gt; user, :action =&gt; &quot;recovery&quot;)
Chris@154 698 </span><span class="marked1"><a name="line98"></a> 98 if token.save
Chris@154 699 </span><span class="marked0"><a name="line99"></a> 99 Mailer.deliver_lost_password(token)
Chris@154 700 </span><span class="marked1"><a name="line100"></a>100 flash[:notice] = l(:notice_account_lost_email_sent)
Chris@154 701 </span><span class="marked0"><a name="line101"></a>101 redirect_to :action =&gt; 'login'
Chris@154 702 </span><span class="marked1"><a name="line102"></a>102 return
Chris@154 703 </span><span class="inferred0"><a name="line103"></a>103 end
Chris@154 704 </span><span class="inferred1"><a name="line104"></a>104 end
Chris@154 705 </span><span class="inferred0"><a name="line105"></a>105 end
Chris@154 706 </span><span class="inferred1"><a name="line106"></a>106 end
Chris@154 707 </span><span class="inferred0"><a name="line107"></a>107
Chris@154 708 </span><span class="inferred1"><a name="line108"></a>108 # User self-registration
Chris@154 709 </span><span class="marked0"><a name="line109"></a>109 def register
Chris@154 710 </span><span class="marked1"><a name="line110"></a>110 redirect_to(home_url) &amp;&amp; return unless Setting.self_registration?
Chris@154 711 </span><span class="marked0"><a name="line111"></a>111 if request.get?
Chris@154 712 </span><span class="marked1"><a name="line112"></a>112 @user = User.new(:language =&gt; Setting.default_language)
Chris@154 713 </span><span class="inferred0"><a name="line113"></a>113 else
Chris@154 714 </span><span class="marked1"><a name="line114"></a>114 @user = User.new(params[:user])
Chris@154 715 </span><span class="marked0"><a name="line115"></a>115 @user.admin = false
Chris@154 716 </span><span class="marked1"><a name="line116"></a>116 @user.login = params[:user][:login]
Chris@154 717 </span><span class="marked0"><a name="line117"></a>117 @user.status = User::STATUS_REGISTERED
Chris@154 718 </span><span class="marked1"><a name="line118"></a>118 @user.password, @user.password_confirmation = params[:password], params[:password_confirmation]
Chris@154 719 </span><span class="marked0"><a name="line119"></a>119 case Setting.self_registration
Chris@154 720 </span><span class="marked1"><a name="line120"></a>120 when '1'
Chris@154 721 </span><span class="inferred0"><a name="line121"></a>121 # Email activation
Chris@154 722 </span><span class="marked1"><a name="line122"></a>122 token = Token.new(:user =&gt; @user, :action =&gt; &quot;register&quot;)
Chris@154 723 </span><span class="marked0"><a name="line123"></a>123 if @user.save and token.save
Chris@154 724 </span><span class="marked1"><a name="line124"></a>124 Mailer.deliver_register(token)
Chris@154 725 </span><span class="marked0"><a name="line125"></a>125 flash[:notice] = l(:notice_account_register_done)
Chris@154 726 </span><span class="marked1"><a name="line126"></a>126 redirect_to :action =&gt; 'login'
Chris@154 727 </span><span class="inferred0"><a name="line127"></a>127 end
Chris@154 728 </span><span class="marked1"><a name="line128"></a>128 when '3'
Chris@154 729 </span><span class="inferred0"><a name="line129"></a>129 # Automatic activation
Chris@154 730 </span><span class="marked1"><a name="line130"></a>130 @user.status = User::STATUS_ACTIVE
Chris@154 731 </span><span class="marked0"><a name="line131"></a>131 if @user.save
Chris@154 732 </span><span class="marked1"><a name="line132"></a>132 self.logged_user = @user
Chris@154 733 </span><span class="marked0"><a name="line133"></a>133 flash[:notice] = l(:notice_account_activated)
Chris@154 734 </span><span class="marked1"><a name="line134"></a>134 redirect_to :controller =&gt; 'my', :action =&gt; 'account'
Chris@154 735 </span><span class="inferred0"><a name="line135"></a>135 end
Chris@154 736 </span><span class="inferred1"><a name="line136"></a>136 else
Chris@154 737 </span><span class="inferred0"><a name="line137"></a>137 # Manual activation by the administrator
Chris@154 738 </span><span class="marked1"><a name="line138"></a>138 if @user.save
Chris@154 739 </span><span class="inferred0"><a name="line139"></a>139 # Sends an email to the administrators
Chris@154 740 </span><span class="marked1"><a name="line140"></a>140 Mailer.deliver_account_activation_request(@user)
Chris@154 741 </span><span class="marked0"><a name="line141"></a>141 flash[:notice] = l(:notice_account_pending)
Chris@154 742 </span><span class="marked1"><a name="line142"></a>142 redirect_to :action =&gt; 'login'
Chris@154 743 </span><span class="inferred0"><a name="line143"></a>143 end
Chris@154 744 </span><span class="inferred1"><a name="line144"></a>144 end
Chris@154 745 </span><span class="inferred0"><a name="line145"></a>145 end
Chris@154 746 </span><span class="inferred1"><a name="line146"></a>146 end
Chris@154 747 </span><span class="inferred0"><a name="line147"></a>147
Chris@154 748 </span><span class="inferred1"><a name="line148"></a>148 # Token based account activation
Chris@154 749 </span><span class="marked0"><a name="line149"></a>149 def activate
Chris@154 750 </span><span class="marked1"><a name="line150"></a>150 redirect_to(home_url) &amp;&amp; return unless Setting.self_registration? &amp;&amp; params[:token]
Chris@154 751 </span><span class="marked0"><a name="line151"></a>151 token = Token.find_by_action_and_value('register', params[:token])
Chris@154 752 </span><span class="marked1"><a name="line152"></a>152 redirect_to(home_url) &amp;&amp; return unless token and !token.expired?
Chris@154 753 </span><span class="marked0"><a name="line153"></a>153 user = token.user
Chris@154 754 </span><span class="marked1"><a name="line154"></a>154 redirect_to(home_url) &amp;&amp; return unless user.status == User::STATUS_REGISTERED
Chris@154 755 </span><span class="marked0"><a name="line155"></a>155 user.status = User::STATUS_ACTIVE
Chris@154 756 </span><span class="marked1"><a name="line156"></a>156 if user.save
Chris@154 757 </span><span class="marked0"><a name="line157"></a>157 token.destroy
Chris@154 758 </span><span class="marked1"><a name="line158"></a>158 flash[:notice] = l(:notice_account_activated)
Chris@154 759 </span><span class="inferred0"><a name="line159"></a>159 end
Chris@154 760 </span><span class="marked1"><a name="line160"></a>160 redirect_to :action =&gt; 'login'
Chris@154 761 </span><span class="inferred0"><a name="line161"></a>161 end
Chris@154 762 </span><span class="inferred1"><a name="line162"></a>162
Chris@154 763 </span><span class="marked0"><a name="line163"></a>163 private
Chris@154 764 </span><span class="marked1"><a name="line164"></a>164 def logged_user=(user)
Chris@154 765 </span><span class="marked0"><a name="line165"></a>165 if user &amp;&amp; user.is_a?(User)
Chris@154 766 </span><span class="marked1"><a name="line166"></a>166 User.current = user
Chris@154 767 </span><span class="marked0"><a name="line167"></a>167 session[:user_id] = user.id
Chris@154 768 </span><span class="inferred1"><a name="line168"></a>168 else
Chris@154 769 </span><span class="marked0"><a name="line169"></a>169 User.current = User.anonymous
Chris@154 770 </span><span class="marked1"><a name="line170"></a>170 session[:user_id] = nil
Chris@154 771 </span><span class="inferred0"><a name="line171"></a>171 end
Chris@154 772 </span><span class="marked1"><a name="line172"></a>172 end
Chris@154 773 </span><span class="inferred0"><a name="line173"></a>173 end
Chris@154 774 </span></pre><hr/>
Chris@154 775 <p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a>
Chris@154 776 version 0.8.1.2.</p>
Chris@154 777 <p><a href='http://validator.w3.org/check/referer'><img src='http://www.w3.org/Icons/valid-xhtml10' height='31' alt='Valid XHTML 1.0!' width='88'/>
Chris@154 778 </a>
Chris@154 779 <a href='http://jigsaw.w3.org/css-validator/check/referer'><img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px'/>
Chris@154 780 </a>
Chris@154 781 </p>
Chris@154 782 </body>
Chris@154 783 </html>