diff --git a/mozilla/webtools/update/css/base/content.css b/mozilla/webtools/update/css/base/content.css new file mode 100755 index 00000000000..1ee2aa9174b --- /dev/null +++ b/mozilla/webtools/update/css/base/content.css @@ -0,0 +1,492 @@ +/* mozilla.org Base Styles + * maintained by fantasai + * (classes defined in the Markup Guide - http://mozilla.org/contribute/writing/markup ) + */ +/* Suggested order: + * display + * list-style + * position + * float + * clear + * width + * height + * margin + * padding + * border + * background + * color + * font + * text-decoration + * text-align + * vertical-align + * white-space + * other text + * content + * + */ + +/* TOC: + Random HTML Styles + Forms + General Structure + Navigation + Quotations + Comments and Other Asides + Emphasis + Computers - General + Code + Examples and Figures + Q and A (FAQ) + Tables + Headers + Meta + Specific to Products Pages +*/ +/* Random HTML Styles */ + + dt { + font-weight: bold; + } + + dd { + margin: 0 0 1em 1em; + } + + li { + margin-top: 0.2em; + margin-bottom: 0.2em; + } + + sup { + font-size: 70%; + } + + form { + margin: 0; + display: inline; + } + + label { + font-weight: bold; + } + + .deepLevel #mainContent :link img, + .deepLevel #mainContent :visited img { + border: medium solid; + } + +/* General Structure */ + + .subtitle { + font-style: italic; + } + + div.para { + margin: 1em 0; + } + + div.section { + display: block; + padding-left: 3%; + } + + div.section > h2, + div.section > h3, + div.section > h4, + div.section > h5, + div.section > h6 { + margin-left: -1.3%; + } + + .imgright { + float: right; + margin: 0 0 2em 2em; + } + + .first { + margin-top: 0; /* For IE not understanding first:child */ + } + +/* Navigation */ + + :link img, + :visited img { + border: 0; + } + + .ex-ref { + font-style: italic; + } + + dl.toc dt { + margin-top: 1em; + font-size: 110%; + } + dl.toc p { + margin: 0; + text-indent: 1em; + } + dl.toc p:first-child { + text-indent: 0; + } + dl.toc > dd { + margin-left: 1em; + } + + ol.toc ol { + list-style-type: circle; + } + ol.toc > li > ol { + font-size: 90%; + } + + ul.snav {/* section navigation or short navigation, whichever you prefer */ + margin: 0.7em 10%; + padding: .2em; + text-align: center; + } + ul.snav > li { + list-style-type: none; + margin: 0; + padding: 0; + } + ul.snav > li { + display: inline; + } + ul.snav > li:before { + content: " | "; + } + ul.snav > li:first-child:before { + content: ""; + } + + a.cont { + display: block; + margin-right: 0; + text-align: right; + } + +/* Quotations */ + + blockquote > address { + padding-left: 1em; + text-indent: -1em; + } + blockquote > address:before { + content: "\2015"; + } + + div.quote, + div.epigraph { + margin: 1em; + } + div.quote q, + div.epigraph q { + display: block; + margin: 0 .5em; + text-indent: -0.5em; + } + div.quote cite, + div.epigraph cite { + display: block; + padding: 0 1em; + text-align: right; + text-indent: -1em; + } + div.quote cite:before, + div.epigraph cite:before { + content: "\2015"; + } + + blockquote.epigraph, + div.epigraph q { + font-style: italic; + text-align: right; + } + blockquote.epigraph em, + div.epigraph q em { + font-style: normal; + } + blockquote.epigraph address, + div.epigraph cite { + font-style: normal; + } + +/* Comments and other Asides */ + + .note { + font-style: italic; + } + .note:before { + content: "Note: "; + } + + .remark { + font-size: smaller; + } + .remark:before { + content: "["; + } + .remark:after { + content: "]"; + } + + .sidenote { + clear: both; + margin: 0.75em 0.5em; + padding: 0.2em; + border: 1px solid; + + /* Block NS4 from floating */ /*/*/ + float: right; + width: 30%; + min-width: 15em; + /* */ + } + /* Reduce main header sizes */ + .sidenote h1 {font-size: 1.40em;} + .sidenote h2 {font-size: 1.25em;} + .sidenote h3 {font-size: 1.10em;} + + .key-point > h1:first-child, + .key-point > h2:first-child, + .key-point > h3:first-child, + .key-point > h4:first-child, + .key-point > h5:first-child, + .key-point > h6:first-child { + margin-top: 0; + } + +/* Emphasis */ + + /* em, strong */ + + strong.stronger { + font-style: italic; + font-weight: bold; + } + + strong.very-strong { + font-weight: bold; + text-transform: uppercase; + } + + *.important, + div.important, + p.important { + margin: 1em; + padding: 0.1em; + border: solid #F00; + font-size: larger; + } + +/* Computers - General */ + + pre.screen { + overflow: auto; + margin: 1em 0.5em; + padding: 0.2em; + border: solid 1px; + font-family: monospace; + white-space: pre; + } + + div.screen { + margin: 1em .5em; + padding: 0.2em; + border: solid 1px; + } + + span.application { + font-style: italic; + } + + kbd.command, + code.command { + white-space: pre; + } + + code.filename { + font-style: italic; + white-space: nowrap; + } + +/* Code */ + + code { + white-space: pre; + } + + pre.code { + overflow: auto; + margin: 1em .5em; + padding: .2em; + border: solid 1px; + } + + pre.code .remark { + font-size: 1em; + font-style: italic; + } + + /* turn off content generation */ + pre.code .remark:before, + pre.code .remark:after, + pre.code .note:before { + content: ""; + } + + +/* Examples and Figures */ + + .example { + margin: 1em 3%; + padding: .25em; + border: solid; + } + .example:before { + display: block; + font-weight: bold; + content: "Example"; + } + .example[title]:before { + content: "Example: " attr(title); + } + + pre.bad, + div.bad { + border: dashed red 3px; + } + .bad.example:before { + content: "Incorrect Example"; + } + .bad.example[title]:before { + content: "Incorrect Example: " attr(title); + } + + pre.good, + div.good { + border: double lime 3px; + } + .good.example:before { + content: "Correct Example"; + } + .good.example[title]:before { + content: "Correct Example: " attr(title); + } + + .figure, + .screenshot { + display: block; + margin: .75em auto; + } + .screenshot[title]:after, + .figure[title]:after { + display: block; + margin: 0 8% .05em; + font-style: italic; + font-size: small; + text-align: right; + content: attr(title); + } + + .co, + .callout { + text-decoration: underline; + } + +/* Q and A (FAQ) */ + + .qandaset .question { + font-size: large; + font-weight: bold; + } + + .qandaset .answer { + margin-top: 1em; + } + +/* Tables */ + + table.data { + border-collapse: collapse; + margin: 0.5em auto; + border: 1px solid; + } + + table.data caption { + margin: 1em auto 0.2em; + font-size: small; + font-style: italic; + text-align: center; + } + + table.data th, + table.data td { + padding: 0.2em; + border: 1px solid; + } + +/* Meta */ + + address { + text-align: right; + } + .author { + margin-bottom: 1em; + text-align: left; + } + + +/* Headers */ + + #mainContent > h1:first-child, + #mainContent > h2:first-child, + #mainContent > h3:first-child, + #mainContent > h4:first-child, + #mainContent > h5:first-child, + #mainContent > h6:first-child, + #side > h1:first-child, + #side > h2:first-child, + #side > h3:first-child, + #side > h4:first-child, + #side > h5:first-child, + #side > h6:first-child { + margin-top: 0; + } + + +/* Specific to Products Pages */ + +.productlist { + margin: 0; + padding: 0 0 0 5px; +} + +.productlist li { + clear: left; + list-style: none; + padding: 0 0 1em 0; + margin-left: 0; +} + +.productlist h3 { + margin: 0 0 0.2em 0; +} + +.productlist img { + float: left; + margin: 0 0.5em 1em 0; + display: auto; +} + +/* Random Stuff That Needs To Be Cleaned Up / Deprecated */ + +.flLeft { + float: left; + margin: 5px 10px 5px 0; +} +.flRight { + float: right; + margin: 5px 0 5px 10px; +} diff --git a/mozilla/webtools/update/css/base/template.css b/mozilla/webtools/update/css/base/template.css new file mode 100755 index 00000000000..b1a6db494b3 --- /dev/null +++ b/mozilla/webtools/update/css/base/template.css @@ -0,0 +1,104 @@ +/* mozilla.org Base Template Styles + * Initial Design by Dave Shea + * Severely tweaked by David Baron + * Reorganized by fantasai + * Large Changes for new Cavendish default by Daniel Burka and Steven Garrity + */ + +/* Basic Structure */ + body { + min-width: 610px; + margin: 20px; + } + + #container { + max-width: 70em; + margin: 0 auto; + } + + #mBody { + clear: both; + padding: 0 0 1em 0; + } + + #side { + float: left; + width: 23%; + margin-bottom: 1em; + } + + #mainContent { + margin-left: 25%; + } + .nomenu #mainContent { + margin-left: 0; + } + .bodyleft { + margin-left: 25% ! important + } + #mainContent.right { + float: left; + width: 62%; + margin-bottom: 1em; + margin-left: 0; + } + + #side.right { + float: none; + width: auto; + margin-left: 65%; + } + +/* Header */ + + #header { margin-bottom: 1em; } + #header ul { + margin: 0 0 1em 0; + padding: 0; + } + + #header li { + display: inline; + padding: 0 20px 0 0; + margin: 0; + white-space: nowrap; + } + +/* Sidebar */ + + #getcd { + margin: 1em 0 0 45px; + } + +/* Footer */ + + #footer { + clear: both; + margin-top: 1em; + } + + #footer ul { + margin: 0 0 1em 0; + padding: 0; + } + + #footer li { + display: inline; + padding: 0 20px 0 0; + margin: 0; + white-space: nowrap; + } + + #footer p { + margin: 0.6em 0; + } + +/*accessibility tweaks*/ + .skipLink { + position: absolute; + left: -999px; + width: 990px; + } + hr.hide { + display: none; + } diff --git a/mozilla/webtools/update/css/cavendish/content.css b/mozilla/webtools/update/css/cavendish/content.css new file mode 100755 index 00000000000..6f584dd8736 --- /dev/null +++ b/mozilla/webtools/update/css/cavendish/content.css @@ -0,0 +1,349 @@ +/* mozilla.org MezzoTan Content Styles + * Initial Design by Dave Shea + * Reorganized and Expanded to include Markup Reference classes by fantasai + */ +/* Suggested order: + * display + * list-style + * position + * float + * clear + * width + * height + * margin + * padding + * border + * background + * color + * font + * text-decoration + * text-align + * vertical-align + * white-space + * other text + * content + * + */ + +/* TOC: + Body + Random HTML Styles + Forms + General Structure + Navigation + Quotations + Comments and Other Asides + Emphasis + Computers - General + Code + Examples and Figures + Q and A (FAQ) + Tables + Meta +*/ + +/* Body */ + + body { + background: #fff; + } + + #mainContent, #side { + background: #fff; + line-height: 1.3; /* value other than 'normal' needed for WinIE */ + } + .deepLevel #mainContent { + line-height: 1.4; + } + +/* Random HTML Styles */ + + hr { + height: 1px; + background-color: #000; + color: #000; + margin: 2em 0; + } + + input[type="submit"] { + font-weight: bold; + } + +/* General Structure */ + body, td, th, input { /* redundant rules for bad browsers */ + font-family: verdana, sans-serif; + font-size: x-small; + voice-family: "\"}\""; + voice-family: inherit; + font-size: small; + } + + h1, h2, h3, h4, h5, h6 { + margin: 1em 0 0.2em 0; + border-bottom: 1px solid #ccc; + font-family: arial, verdana, sans-serif; + } + + #header h1 { border: 0; } + + h1 { font-size: 160%; font-weight: normal; } + h2 { font-size: 150%; font-weight: normal; } + h3 { font-size: 120%; } + h4 { font-size: 100%; } + h5 { font-size: 90%; } + h6 { font-size: 90%; border: 0; } + +/* Navigation */ + + a:link { color: #039; } + a:visited { color: #636; } + a:hover { color: #333; } + a:active { color: #000; } + +/* Quotations */ + + +/* Comments and other Asides */ + + .note { + color: #666; + font-style: normal; + } + + .remark { + color: #666; + } + + .sidenote { + border: #666; + } + + .key-point:before { + line-height: 0.1; + font-size: 1px; + background: transparent url("../../images/key-point_tr.gif") no-repeat top right; + margin: -15px -15px 0 -15px; + height: 15px; + display: block; + border: none; + content: url("../../images/key-point_tl.gif"); + } + .key-point { + background: #e4ecec url("../../images/key-point_back.gif") right repeat-y; + padding: 15px; + margin-bottom: 1em; + } + .key-point:after { + display: block; + clear: both; + padding-top: 15px; + line-height: 0.1; + font-size: 1px; + content: url("../../images/key-point_bl.gif"); + margin: -15px; + height: 8px; + background: transparent url("../../images/key-point_br.gif") scroll no-repeat bottom right ; + } + + .key-point h2, .key-point h3, .key-point h4, .key-point h5 { + border: none; + margin-top: 0; + } + + .news dt { + font-weight: normal; + color: #666; + } + .news dt a { + font-weight: bold; + } + + ul.compact { + margin-left: 0; + padding-left: 20px; + } + +/* Emphasis */ + +/* Computers - General */ + + kbd { + margin: 0.1em; + padding: 0.1em; + border: 1px #ccc; + } + + kbd.command, + code.command { + color: #6B5839; + } + +/* Code */ + + pre.code { + margin: 0.1em; + padding: 0.1em; + background: #EEECF6; + } + + code > em, + code > strong, + pre.code > em, + pre.code > strong { + font-style: normal; + } + +/* Examples and Figures */ + + div.example { + border-color: #554FA0; + } + div.example::before { + color: #666; + } + +/* Tables */ + + table.data { + border-style: none hidden; + } + + table.data thead { + background: #EEECF6; + } + + table.data th, + table.data td { + border: 1px dotted #D6CCBD; + } + + tr.odd { + background: #F5F5F5; + } + +/* Meta */ + + address { + color: #666; + } + +/* Product Specific CSS */ + + .productlist h3 { + border: none; + } + + .key-point h3 { + margin: 0; + } + + #product-desc h2 { + text-indent: -700em; + height: 25px; + line-height: 2px; + font-size: 2px; + } + + #product-desc p { + padding-left: 170px; + } + + #product-side { + margin-left: 65%; + } + + #product-side ul { + margin-left: 0; + padding-left: 20px; + } + + #product-side li { + padding-bottom: 0.2em; + } + + #product-desc { + padding: 40px 0 25px 0; + color: #4C5C5C; + width: 60%; + float: left; + line-height: 140%; + } + + .product-firefox { + background: url("../../images/product-firefox-screen.png") no-repeat; + } + .product-thunderbird { + background: url("../../images/product-thunderbird-screen.png") no-repeat; + } + .product-camino { + background: url("../../images/product-camino-screen.png") no-repeat; + } + .product-mozilla { + background: url("../../images/product-mozilla-screen.png") no-repeat; + } + + .download h3 { + color: #1D9101; + font-weight: bold; + margin: 0; + font-size: 140%; + } + + .download h3 a:link, + .download h3 a:visited, + .download h3 a:active { + color: #1D9101; + } + + .download h3 a:hover { + color: #156B01; + } + + .download:before { + line-height: 0.1; + font-size: 1px; + margin: -15px -15px 0 -15px; + height: 15px; + display: block; + border: none; + content: url("../../images/download_tl.gif"); + } + .download { + background: #C4EFA1 url("../../images/download_back.gif") top right no-repeat; + padding: 15px 45px 15px 15px; + margin-bottom: 0.5em; + } + .download:after { + display: block; + padding-top: 15px; + line-height: 0.1; + font-size: 1px; + content: url("../../images/download_bl.gif"); + margin: -10px -45px -15px -15px; + height: 8px; + background: transparent url("../../images/download_br.gif") scroll no-repeat bottom right ; + } + + .shop:before { + line-height: 0.1; + font-size: 1px; + margin: -15px -15px 0 -15px; + height: 15px; + display: block; + border: none; + content: url("../../images/shop_tl.gif"); + } + .shop { + background: #C0DCDC url("../../images/shop_back.gif") top right no-repeat; + padding: 15px 70px 15px 15px; + } + .shop:after { + display: block; + padding-top: 15px; + line-height: 0.1; + font-size: 1px; + content: url("../../images/shop_bl.gif"); + margin: -10px -70px -15px -15px; + height: 8px; + background: transparent url("../../images/shop_br.gif") scroll no-repeat bottom right ; + } diff --git a/mozilla/webtools/update/css/cavendish/home.css b/mozilla/webtools/update/css/cavendish/home.css new file mode 100755 index 00000000000..e7f6ecb02e7 --- /dev/null +++ b/mozilla/webtools/update/css/cavendish/home.css @@ -0,0 +1,125 @@ +h2 a { text-decoration: none; } +h2 a:link { color: #000; } +h2 a:visited { color: #000; } +h2 a:hover { color: #039; } + +#mBody h2 { margin-top: 0; } +#mBody p { margin-top: 0; } + +.front-feature-cnet { background: #E4ECEC url(/images/feature-back-cnet.png) bottom right no-repeat; } +.front-feature-wired { background: #E4ECEC url(/images/feature-back-wired.png) bottom right no-repeat; } +.front-feature-nytimes { background: #E4ECEC url(/images/feature-back-nytimes.png) bottom right no-repeat; } +.front-feature-onion { background: #E4ECEC url(/images/feature-back-onion.png) bottom right no-repeat; } +.front-feature-slate { background: #E4ECEC url(/images/feature-back-slate.png) bottom right no-repeat; } +.front-feature-nasa { background: #E4ECEC url(/images/feature-back-nasa.png) bottom right no-repeat; } + +#firefox-feature { + position: relative; +} + +#firefox-feature ul { + margin: 0.5em 0 0 0; + padding: 0; +} + +#firefox-feature li { + list-style: none; + margin-left: 1.5em; +} + +#firefox-feature li a { + display: block; + padding: 5px 0 7px 34px; + text-decoration: none; +} + +#firefox-feature li a .front-link { + text-decoration: underline; +} + +a#shopLink { + display: block; + padding: 2px 4px 10px 32px; + background: url(/images/front-shop.gif) no-repeat; +} + +div.extrainfo { + margin-top: 10px; +} + +#firefox-feature p { + margin: 0 0 1em 0; + line-height: 140%; +} + +#firefox-feature #feature-content { + padding: 6px 330px 10px 10px; +} + +#featurelink { + display: block; + width: 350px; + height: 235px; + position: absolute; + bottom: 0; + right: 0; + text-decoration: none; + text-indent: -2500px; +} + +ul.news { + margin: 0.5em 0 0 0; + padding: 0; +} + +.news li { + margin: 0 0 0.7em 0; + padding: 0; + clear: both; + list-style-type: none; +} +.news li a { font-weight: normal; } + +.news .date { + background: #eee; + border-right: 1px solid #ccc; + border-bottom: 1px solid #ccc; + float: left; + text-align: center; + margin: 0 5px 5px 0; + line-height: 1.1em; + padding: 2px; + font-size: 11px; + width: 4em; + white-space: nowrap; +} + +img.rss { + float: right; + margin: 0; + padding: 4px 4px 0 0; +} + +img.promo { + margin: 0 0 8px 8px; + float: right; +} + +.frontcolumn { + width: 30%; + float: left; + padding-right: 3%; +} + +.frontcolumnlast { + width: 33%; + float: left; +} + +.homepage .download { + width: 200px; +} + +.homepage .shop { + width: 175px; +} diff --git a/mozilla/webtools/update/css/cavendish/template.css b/mozilla/webtools/update/css/cavendish/template.css new file mode 100755 index 00000000000..00454127f6c --- /dev/null +++ b/mozilla/webtools/update/css/cavendish/template.css @@ -0,0 +1,265 @@ +/* mozilla.org Cavendish Template Styles + * Initial Design by Daniel Burka and Steven Garrity +*/ + +/* Basic Structure */ + body { + background: #fff url("../../images/body_back.gif") repeat-x; + } + +/* Header */ + + #header { + background: #455372 url("../../images/header_bl.png") bottom left repeat-x; + position: relative; + min-height: 39px; + height: 5em; + padding: 0; + voice-family: "\"}\""; + voice-family: inherit; + height: 3em; + padding: 15px 0; + } #ignored {} + + #header h1 { + position: absolute; + top: 0; + left: 0; + margin: 0; + font-size: 2px; + background: url("../../images/header_tl.gif") no-repeat; + height: 8px; + z-index: 100; /* above the UL */ + } + #header h1 a { + display: block; + width: 204px; + height: 55px; + background: transparent url("../../images/header_logo.gif") no-repeat; + text-indent: -700em; + text-decoration: none; + } + #header ul { + width: auto; + position: absolute; + bottom: 0; + right: 0; + margin: 0; + padding: 0 15px 0 0; + list-style: none; + background: url("../../images/header_br.gif") no-repeat bottom right; + z-index: 90; /* below the H1 */ + } + #header li { + float: right; + background: transparent url("../../images/header_tab.gif") 100% -600px no-repeat; + padding: 0 6px 0 0; + margin: 0 1px 0 0; + border-bottom: 1px solid #515358; + } + #header ul a { + float: left; + display: block; + padding: 4px 4px 4px 10px; + background: transparent url("../../images/header_tab.gif") 0% -600px no-repeat; + font-weight: bold; + color: #fff; + text-decoration: none; + } + #header ul li:hover a { background-position: 0% -400px; } + #header ul li:hover { background-position: 100% -400px; } + + body.sectionAbout li#menu_aboutus, + body.sectionProducts li#menu_products, + body.sectionSupport li#menu_support, + body.sectionDevelopers li#menu_developers { + background-position: 100% -200px; + } + + body.sectionAbout li#menu_aboutus a, + body.sectionProducts li#menu_products a, + body.sectionSupport li#menu_support a, + body.sectionDevelopers li#menu_developers a { + background-position: 0% -200px; + color: #039; + } + + body.sectionAbout li#menu_aboutus, + body.sectionProducts li#menu_products, + body.sectionSupport li#menu_support, + body.sectionDevelopers li#menu_developers { + border-bottom: 1px solid #fff; + } + + body.sectionAbout li#menu_aboutus:hover, + body.sectionProducts li#menu_products:hover, + body.sectionSupport li#menu_support:hover, + body.sectionDevelopers li#menu_developers:hover { + background-position: 100% 0%; + } + + body.sectionAbout li#menu_aboutus:hover a, + body.sectionProducts li#menu_products:hover a, + body.sectionSupport li#menu_support:hover a, + body.sectionDevelopers li#menu_developers:hover a { + background-position: 0% 0%; + color: #333; + } + +/* Search Field */ + + #header form { + position: absolute; + top: 0; + right: 0; + padding: 12px 20px 0 0; + background: url("../../images/header_tr.gif") no-repeat top right; + margin: 0; /* need for IE Mac */ + text-align: right; /* need for IE Mac */ + white-space: nowrap; /* for Opera */ + } + #header form label { color: #fff; font-size: 85%; } + #header form input { font-size: 85%; } + + #header form #submit { + font-size: 85%; + background: #6A7389; + color: #fff; + padding: 1px 4px; + border-right: 1px solid #283043; + border-bottom: 1px solid #283043; + border-top: 1px solid #9097A2; + border-left: 1px solid #9097A2; + } + + #header form #q { + width: 170px; + font-size: 85%; + border: 1px solid #9097A2; + background: #D9DBE1; + padding: 2px; + } + #header form #q:hover, #header form #q:focus { + background: #fff; + } + +/* Sidebar */ + + #nav:before { + line-height: 0.1; + font-size: 1px; + background: transparent url("../../images/menu_tr.gif") no-repeat top right; + margin: 0; + height: 9px; + display: block; + border-bottom: 1px solid #ddd; + content: url("../../images/key-point_tl.gif"); + } + #nav { + background: #E0E9E9 url("../../images/menu_back.gif") right repeat-y; + } + #nav:after { + display: block; + clear: both; + padding-top: 0; + line-height: 0.1; + font-size: 1px; + content: url("../../images/key-point_bl.gif"); + margin: 0 0 0 0; + height: 8px; + background: transparent url("../../images/menu_br.gif") scroll no-repeat bottom right ; + border-top: 1px solid #fff; + } + + #nav, #nav ul { + margin: 0; + padding: 0; + list-style: none; + } + #nav { + margin-bottom: 1em; + } + #nav li { + fdisplay: inline; /* need for IE spacing issue */ + padding: 0; + margin: 0; + } + + #nav li span { /* used for un-linked menu items */ + display: block; + padding: 6px 10px; + font-weight: bold; + color: #666; + } + + #nav li span#configParent, #nav li span #configuration { + display: inline; + font-weight: normal; + padding: 0; + } + + #nav li a { + display: block; + padding: 6px 10px; + text-decoration: none; + background: #EDF2F2; + border-bottom: 1px solid #ddd; + border-top: 1px solid #fff; + border-right: 1px solid #ddd; + } + + #nav li a:hover { + background: #E0E9E9; + } + + #nav li li a { + padding: 4px 8px 4px 20px; + } + + #oN { + background-color: #E0E9E9; + } + #oN:hover { + background-color: #C6DCDC; + } + +/* Footer */ + + #footer { + border-top: 1px solid #666; + margin: 2em 0; + padding: 1em 0; + text-align: center; + } + + #footer ul { + margin: 0; + padding: 0; + list-style: none; + } + + #footer li { + display: inline; + } + + #footer span,#footer a { + white-space: nowrap; + padding: 0 1em; + } + + #footer p span,#footer p a { + white-space: nowrap; + padding: 0 0.3em; + } + + #footer span a { + padding: 0; + } + + #footer p,#footer p a { + color: #666; + } + + #footer p a:hover { + color: #000; + } diff --git a/mozilla/webtools/update/css/print.css b/mozilla/webtools/update/css/print.css new file mode 100755 index 00000000000..99c5b3f50cb --- /dev/null +++ b/mozilla/webtools/update/css/print.css @@ -0,0 +1,84 @@ +/* mozilla.com print css +by dave shea, http://www.mezzoblue.com/ */ + +/*html elements*/ +body { + background: #fff; + font: 12pt Verdana,Sans-serif; +} + +a img { + border: 0; +} +form { + margin: 0; + display: inline; +} +label, input { + font-weight: bold; +} +h1, h2, h3, h4, h5, h6 { + margin: 0; +} +h1 { + font-size: 120%; + color: #955322; +} +h2 { + font-size: 110%; + color: #B26C38; +} +h2 a:visited { + text-decoration: none; +} +h3 { + color: #EC361D; + font-size: 110%; +} +h4 { + font-size: 110%; + color: #666; +} +h5 { + font-size: 100%; + color: #955322; +} +h6 { + color: #EC361D; + font-size: 100%; +} + +p, li, dt, dd { + font-size: 92%; +} +p { + line-height: 150%; +} +sup { + font-size: 70%; +} +a:link, a:visited { + color: #554FA0; + font-weight: bold; + text-decoration: none; +} + +dt.im { + float: left; +} + +#mainContent a:link:after, #mainContent a:visited:after { + content: " (" attr(href) ") "; + font-size: 70%; + color: #000; +} +#mainContent a[href^="/"]:after { + content: " (http://www.mozilla.org" attr(href) ") "; +} + +#tools, #search, #ad, #bn, #int, .skipLink, #brd { + display: none; +} +#header + hr { + display: none; +} diff --git a/mozilla/webtools/update/developers/additem.php b/mozilla/webtools/update/developers/additem.php new file mode 100755 index 00000000000..b85aa0ec554 --- /dev/null +++ b/mozilla/webtools/update/developers/additem.php @@ -0,0 +1,748 @@ + + + + +Mozilla Update :: Developer Control Panel :: Add Item + + +"Extension","T"=>"Theme"); +$typename = $typearray[$_GET["type"]]; +?> +

Add New

+ + +"> + + +
+Your File:
+
+
+ +
+ +\n"; + +//------------------ +// Construct $manifestdata[] array from install.rdf info. +// Thanks to Chewie[] with the Perl-Compatable RegExps Help. :-) +//------------------- + +// em:id +preg_match("/(.*?)<\/em:id>/", $buf, $matches); +$manifestdata["id"]=$matches[1]; + +// em:version +preg_match("/(.*?)<\/em:version>/", $buf, $matches); +$manifestdata["version"]=$matches[1]; + +//em:targetApplication +preg_match_all("/(.*?)<\/em:targetApplication>/s", $buf, $matches); +//echo"
";
+//print_r($buf);
+//print_r($matches);
+//echo"
"; + foreach ($matches[0] as $targetapp ) { + //em:targetApplication --> em:id + preg_match("/(.*?)<\/em:id>/", $targetapp, $matches); + $i = $matches[1]; + $manifestdata["targetapplication"][$i]["id"]=$matches[1]; + + //em:targetApplication --> em:minVersion + preg_match("/(.*?)<\/em:minVersion>/", $targetapp, $matches); + $manifestdata["targetapplication"][$i]["minversion"]=$matches[1]; + + //em:targetApplication --> em:maxVersion + preg_match("/(.*?)<\/em:maxVersion>/", $targetapp, $matches); + $manifestdata["targetapplication"][$i]["maxversion"]=$matches[1]; + } + +//em:name +preg_match("/(.*?)<\/em:name>/", $buf, $matches); +$manifestdata["name"]=$matches[1]; + +//em:description +preg_match("/(.*?)<\/em:description>/", $buf, $matches); +$manifestdata["description"]=$matches[1]; + +//em:homepageURL +preg_match("/(.*?)<\/em:homepageURL>/", $buf, $matches); +$manifestdata["homepageurl"]=$matches[1]; + + +//echo"

Adding Extension... Checking file...

\n"; +//echo"
"; print_r($manifestdata); echo"
\n"; +//Populate Form Variables from manifestdata. +$id = $manifestdata[id]; +$name = $manifestdata[name]; +$version = $manifestdata[version]; +$homepage = $manifestdata[homepageurl]; +$description = $manifestdata[description]; + + +//Check GUID for validity/existance, if it exists, check the logged in author for permission +$sql = "SELECT ID, GUID from `t_main` WHERE `GUID` = '$manifestdata[id]' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + if (mysql_num_rows($sql_result)=="1") { +// echo"This is a updated extension... Checking author data...
\n"; + $mode = "update"; + $row = mysql_fetch_array($sql_result); + $item_id = $row["ID"]; +if ($_POST["legacy"]=="TRUE") {$item_id = $_POST["existingitems"]; } + $sql = "SELECT `UserID` from `t_authorxref` WHERE `ID`='$item_id' AND `UserID` = '$_SESSION[uid]' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + if (mysql_num_rows($sql_result)=="1" or ($_SESSION["level"]="admin" or $_SESSION["level"]="editor")) { +// echo"This extension belongs to the author logged in
\n"; + } else { + echo"ERROR!! This extension does NOT belong to the author logged in.
\n"; + die("Terminating..."); + } + + } else { + $mode = "new"; +// echo"This is a new extension...
\n"; + } + +//Verify MinAppVer and MaxAppVer per app for validity, if they're invalid, reject the file. +if ($_POST["legacy"]=="TRUE" AND !$manifestdata[targetapplication]) {$manifestdata[targetapplication]=array(); } +foreach ($manifestdata[targetapplication] as $key=>$val) { +//echo"$key -- $val[minversion] $val[maxversion]
\n"; + +$i=0; + $sql = "SELECT `AppName`, `major`, `minor`, `release`, `SubVer` FROM `t_applications` WHERE `GUID`='$key' ORDER BY `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row = mysql_fetch_array($sql_result)) { + $i++; + $appname = $row["AppName"]; + $subver = $row["SubVer"]; + $release = "$row[major].$row[minor]"; + if ($row["release"]) {$release = "$release.$row[release]";} + if ($subver !=="final") {$release="$release$subver";} + if ($release == $val[minversion]) { $versioncheck[$key][minversion_valid] = "true"; } + if ($release == $val[maxversion]) { $versioncheck[$key][maxversion_valid] = "true"; } + + } + if (!$versioncheck[$key][minversion_valid]) { + $versioncheck[$key][minversion_valid]="false"; + echo"Error! The MinAppVer for $appname of $val[minversion] in install.rdf is invalid.
\n"; + $versioncheck[errors]="true"; + } + if (!$versioncheck[$key][maxversion_valid]) { + $versioncheck[$key][maxversion_valid]="false"; + echo"Error! The MaxAppVer for $appname of $val[maxversion] in install.rdf is invalid.
\n"; + $versioncheck[errors]="true"; + } +} + +//echo"
"; print_r($versioncheck); echo"
\n"; + +if ($versioncheck[errors]=="true") { + echo"Errors were encountered during install.rdf checking...
\n"; + die("Aborting..."); +} else { +// echo"install.rdf minAppVer and maxAppVer valid...
\n"; +} + + +} else { +//echo"install.rdf is not present, use legacy mode...
\n"; +//header("Location: http://$_SERVER[HTTP_HOST]/developers/additem.php?function=step1b&filename=$filename"); +echo"

Add Step 1b: Legacy Item Data Entry: ($filename)

\n"; +?> + + +"> + + +
+ + > New
+ > Update to: +
+Your file: "> "> +
+ +
+ + + + +"Extension","T"=>"Theme"); +$type = $_POST["type"]; +$typename = $typearray[$type]; + +if ($mode=="update") { + $sql = "SELECT `Name`, `Homepage`, `Description` FROM `t_main` WHERE `ID` = '$item_id' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $name = $row["Name"]; + $homepage = $row["Homepage"]; + $description = $row["Description"]; + + $authors = ""; $i=""; + $sql = "SELECT TU.UserEmail FROM `t_authorxref` TAX INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID WHERE `ID` = '$item_id'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $numresults = mysql_num_rows($sql_result); + while ($row = mysql_fetch_array($sql_result)) { + $i++; + $email = $row["UserEmail"]; + $authors .= "$email"; + if ($i < $numresults) { $authors .=", "; } + } + +//Get Currently Set Categories for this Object... + $sql = "SELECT TCX.CategoryID, TC.CatName FROM `t_categoryxref` TCX +INNER JOIN t_categories TC ON TCX.CategoryID = TC.CategoryID +WHERE TCX.ID = '$item_id' +ORDER BY `CatName` ASC "; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row = mysql_fetch_array($sql_result)) { + $n++; + $catid = $row["CategoryID"]; + $categories[$n] = $catid; + } +unset($n); +} + +if (!$categories) {$categories = array(); } +?> +

Add New »» Step 2:

+ + +"> + +"> + +"> +"> + + + + + + + + +\n"; + echo"\n"; + echo"\n"; + +echo"\n"; + $sql2 = "SELECT `AppName`,`GUID` FROM `t_applications` GROUP BY `AppName` ORDER BY `AppName` ASC"; + $sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row2 = mysql_fetch_array($sql_result2)) { + $appname = $row2["AppName"]; + $guid = $row2["GUID"]; + if ($appname == "Mozilla") { $mozguid = $guid; } + $minappver = $manifestdata["targetapplication"]["$guid"]['minversion']; + $maxappver = $manifestdata["targetapplication"]["$guid"]['maxversion']; + echo"\n"; + } } +} +?> + + + +\n"; +?> + + + + +
Name* " SIZE=45 MAXLENGTH=100>Categories:
    
Author(s):*" SIZE=45>
Version:*
OS*
Filename:$filename ($filesize"."kb)
Target Application(s):
$appname "; + +if (($mode=="new" or $mode=="update") and (strtolower($appname) !="mozilla" or $manifestdata["targetapplication"]["$mozguid"])) { + //Based on Extension Manifest (New Mode) + if ($minappver and $maxappver) { + echo"$minappver - $maxappver\n"; + echo"\n"; + echo"\n"; + } else { + echo"N/A"; + } +} else { + //Legacy Mode Code... + if ($appname =="Firefox" or $appname == "Thunderbird") { + echo"
Incompatable with Legacy Extensions (Requires install.rdf)"; + } else { + +$sql = "SELECT `version`,`major`,`minor`,`release`,`SubVer` FROM `t_applications` WHERE `AppName` = '$appname' ORDER BY `major` ASC, `minor` ASC, `release` ASC, `SubVer` ASC"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); +echo"\n"; + + echo" - "; + +$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); +echo"\n"; + echo"
Homepage " SIZE=60 MAXLENGTH=200>
Description*
Version Notes:
  
+ +1) { + //Too many e-mails match, store individual data for error block. + $r++; + $emailerrors[$a]["foundemails"][$r] = $useremail; + } + $authorids[] = $userid; + $authoremails[] = $useremail; + } + if ($numresults !="1") { + //No Valid Entry Found for this E-Mail or too many, kill and store data for error block. + $emailerrors[$a]["author"] = "$author"; + $updateauthors = "false"; // Just takes one of these to kill the author update. + } +} +unset($a,$r); + + + +if ($_POST["name"] AND $_POST["type"] AND $_POST["authors"] AND $updateauthors !="false" AND $_POST["version"] AND $_POST["osid"] AND $_POST["filename"] AND $_POST["filesize"] AND $_POST["description"] AND $minappver AND $maxappver) { +//All Needed Info is in the arrays, procceed with inserting... + +//Create DIV for Box around the output... + echo"

Adding Item... Please Wait...

\n"; + echo"
\n"; + +//Phase One, Main Data +$name = $_POST["name"]; +$homepage = $_POST["homepage"]; +$description = $_POST["description"]; +$item_id = $_POST["item_id"]; +$guid = $_POST["guid"]; +$type = $_POST["type"]; +if ($_POST["mode"]=="update") { +$sql = "UPDATE `t_main` SET `Name`='$name', `Homepage`='$homepage', `Description`='$description', `DateUpdated`=NOW(NULL) WHERE `ID`='$item_id' LIMIT 1"; +} else { +$sql = "INSERT INTO `t_main` (`GUID`, `Name`, `Type`, `Homepage`,`Description`,`DateAdded`,`DateUpdated`) VALUES ('$guid', '$name', '$type', '$homepage', '$description', NOW(NULL), NOW(NULL));"; +} + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); +if ($sql_result) {echo"Updating/Adding record for $name...
\n";} + + +//Get ID for inserted row... if we don't know it already +if (!$_POST[item_id] and $_POST["mode"] !=="update") { + $sql = "SELECT `ID` FROM `t_main` WHERE `GUID`='$_POST[guid]' AND `Name`='$_POST[name]' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $id = $row["ID"]; + } else { + $id = $_POST["item_id"]; + } + + +//Phase 2 -- Commit Updates to AuthorXref tables.. with the ID and UserID. +if ($updateauthors != "false") { + //Remove Current Authors + $sql = "DELETE FROM `t_authorxref` WHERE `ID` = '$id'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + + //Add New Authors based on $authorids + sort($authorids); + foreach ($authorids as $authorid) { + $sql = "INSERT INTO `t_authorxref` (`ID`, `UserID`) VALUES ('$id', '$authorid');"; + $result = mysql_query($sql) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + } + if ($result) { echo"Authors added...
\n"; } +} else { + echo"ERROR: Could not update Authors list, please fix the errors printed below and try again...
\n"; +} + +unset($authors); //Clear from Post.. + + +// Phase 3, t_categoryxref + +if (!$_POST["categories"]) { +//No Categories defined, need to grab one to prevent errors... + $sql = "SELECT `CategoryID` FROM `t_categories` WHERE `CatType`='$type' AND `CatName`='Miscellaneous' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row = mysql_fetch_array($sql_result)) { + $_POST["categories"] = array("$row[CategoryID]"); + } + +} + + //Delete Current Category Linkages... + $sql = "DELETE FROM `t_categoryxref` WHERE `ID` = '$id'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + + //Add New Categories from $_POST["categories"] + foreach ($_POST["categories"] as $categoryid) { + $sql = "INSERT INTO `t_categoryxref` (`ID`, `CategoryID`) VALUES ('$id', '$categoryid');"; + $result = mysql_query($sql) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + } + if ($result) {echo"Categories added...
\n"; } + + +//Phase 4, t_version rows + +//Construct Internal App_Version Arrays +$i=0; +$sql = "SELECT `AppName`, `int_version`, `major`, `minor`, `release`, `SubVer`, `shortname` FROM `t_applications` ORDER BY `AppName`, `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row = mysql_fetch_array($sql_result)) { + $i++; + $appname = $row["AppName"]; + $int_version = $row["int_version"]; + $subver = $row["SubVer"]; + $release = "$row[major].$row[minor]"; + if ($row["release"]) {$release = "$release.$row[release]";} + if ($subver !=="final") {$release="$release$subver";} + $app_internal_array[$release] = $int_version; + $app_shortname[strtolower($appname)] = $row["shortname"]; + } + + $sql2 = "SELECT `AppName`,`AppID` FROM `t_applications` GROUP BY `AppName` ORDER BY `AppName` ASC"; + $sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row2 = mysql_fetch_array($sql_result2)) { + $appname = $row2["AppName"]; + $appid = $row2["AppID"]; + $minappver = $_POST["$appname-minappver"]; + $maxappver = $_POST["$appname-maxappver"]; + +if ($minappver and $maxappver) { + +if ($app_internal_array["$minappver"]) {$minappver_int = $app_internal_array["$minappver"]; } +if ($app_internal_array["$maxappver"]) {$maxappver_int = $app_internal_array["$maxappver"]; } +if (!$minappver_int) {$minappver_int = $minappver;} +if (!$maxappver_int) {$maxappver_int = $maxappver;} + + +$version = $_POST["version"]; +$osid = $_POST["osid"]; +$filesize = $_POST["filesize"]; +$uri = ""; //we don't have all the parts to set a uri, leave blank and fix when we do. +$notes = $_POST["notes"]; + +//If a record for this item's exact version, OS, and app already exists, find it and delete it, before inserting + $sql3 = "SELECT `vID` from `t_version` TV INNER JOIN `t_applications` TA ON TA.AppID=TV.AppID WHERE `OSID`='$osid' AND `AppName` = '$appname' AND TV.Version='$version' ORDER BY `vID` ASC"; + $sql_result3 = mysql_query($sql3, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row = mysql_fetch_array($sql_result3)) { + $sql = "DELETE FROM `t_version` WHERE `vID`='$row[vID]' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + if ($sql_result) { echo"Warning! A version Record already exists for this item's Application/OS/Version combination. Deleting.
\n"; } + } + +$sql = "INSERT INTO `t_version` (`ID`, `Version`, `OSID`, `AppID`, `MinAppVer`, `MinAppVer_int`, `MaxAppVer`, `MaxAppVer_int`, `Size`, `URI`, `Notes`, `DateAdded`, `DateUpdated`) VALUES ('$id', '$version', '$osid', '$appid', '$minappver', '$minappver_int', '$maxappver', '$maxappver_int', '$filesize', '$uri', '$notes', NOW(NULL), NOW(NULL));"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + if ($sql_result) {echo"Added $name version $version for $appname
\n"; $apps_array[]=$app_shortname[strtolower($appname)];} + +$sql = "SELECT `vID` from `t_version` WHERE `id` = '$id' ORDER BY `vID` DESC LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $vid_array[] = $row["vID"]; +} +} + +$sql = "SELECT `OSName` FROM `t_os` WHERE `OSID`='$osid' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $osname = $row["OSName"]; + + +//Construct the New Filename +$filename_array = explode(".",$_POST[filename]); +$filename_count = count($filename_array)-1; +$fileext = $filename_array[$filename_count]; + +$itemname = str_replace(" ","_",$name); +$j=0; $app=""; +$app_count = count($apps_array); +foreach ($apps_array as $app_val) { +$j++; +$apps .="$app_val"; +if ($j<$app_count) {$apps .="+"; } +} +$newfilename = "$itemname-$version-$apps"; +if (strtolower($osname) !=="all") {$newfilename .="-".strtolower($osname).""; } +$newfilename .=".$fileext"; + + +//Move temp XPI to home for approval queue items... +$oldpath = "$repositorypath/temp/$_POST[filename]"; +$newpath = "$repositorypath/approval/".strtolower($newfilename); +if (file_exists($oldpath)) { + rename("$oldpath","$newpath"); + echo"File $newfilename saved to disk...
\n"; +} +$uri = str_replace("$repositorypath/approval/","http://$sitehostname/developers/approvalfile.php/",$newpath); +//echo"$newfilename ($oldpath) ($newpath) ($uri)
\n"; + +foreach ($vid_array as $vid) { + $sql = "UPDATE `t_version` SET `URI`='$uri' WHERE `vID`='$vid'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); +} + +//Approval Queue +$_SESSION["trusted"]=="FALSE"; + //Trusted User Code Not Yet Implemented, needs a shared function w/ the approval queue + // for file moving, creation. (and sql updating?) + //Check if the item belongs to the user, (special case for where admins are trusted, the trust only applies to their own work.) + $sql = "SELECT `UserID` from `t_authorxref` WHERE `ID`='$id' AND `UserID` = '$_SESSION[uid]' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + if (mysql_num_rows($sql_result)=="1" AND $_SESSION["trusted"]=="TRUE") { + //User is trusted and the item they're modifying inheirits that trust. + $action = "Approval+"; + $comments = "Auto-Approval for Trusted User"; + //$typenames = array("E"=>"extensions","T"=>"themes"); + //$typename = $typenames[$type]; + + //$uri = strtolower(str_replace("http://$sitehostname/developers/approvalfile.php/","http://ftp.mozilla.org/pub/mozilla.org/$typename/$itemname/",$newpath)); + //foreach ($vid_array as $vid) { + // $sql = "UPDATE `t_version` SET `URI`='$uri' WHERE `vID`='$vid'"; + // $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + //} + + } else { + $action="Approval?"; + $comments=""; + } + + +//Firstly, log the comments and action taken.. +$userid = $_SESSION["uid"]; + +if (!$vid_array) { $vid_array = array(); } +foreach ($vid_array as $vid) { +$sql = "INSERT INTO `t_approvallog` (`ID`, `vID`, `UserID`, `action`, `date`, `comments`) VALUES ('$id', '$vid', '$userid', '$action', NOW(NULL), '$comments');"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); +} + + +echo"Process Complete...

\n"; +echo"$name version $version has been added to the Mozilla Update database and is awaiting review by an editor, you will be notified when an editor reviews it.
\n"; +echo"To review or make changes to your submission, visit the Item Details page...
\n"; + +echo"

\n"; +echo"«« Back to Home"; +echo"
\n"; + +} + + +//Author Error Handling/Display Block for Form Post... +if ($emailerrors) { + +echo" +

Adding Item... Error Found while processing authors

\n + +"; + +foreach ($_POST as $key => $val) { +if ($key=="authors" or $key=="submit") {continue; } +if ($key=="categories") { +foreach ($_POST["categories"] as $val) { +echo"\n"; +} +continue; +} +echo"\n"; +} + + +echo"\n"; +$authors = $_POST["authors"]; +?> + +
\n"; +echo"
"; +foreach ($emailerrors as $authorerror) { +$author = $authorerror["author"]; +$count = count($authorerror["foundemails"]); + +if ($count=="0") { +//Error for No Entry Found +echo"Error! Entry '$author': No Matches Found. Please check your entry and try again.
\n"; +} else { +//Error for Too Many Entries Found +echo"Error! Entry '$author': Too Many Matches. Please make your entry more specific.
\n"; +} +if ($count>0 AND $count<6) { +echo"    Possible Addresses found: "; +foreach ($authorerror["foundemails"] as $foundemails) { +$a++; +echo"$foundemails"; + +if ($a != $count) {echo", "; } else {echo"
\n";} +} +} + +} +echo"
Author(s):*" SIZE=70>
+ + + + + \ No newline at end of file diff --git a/mozilla/webtools/update/developers/appmanager.php b/mozilla/webtools/update/developers/appmanager.php new file mode 100755 index 00000000000..628465863e8 --- /dev/null +++ b/mozilla/webtools/update/developers/appmanager.php @@ -0,0 +1,211 @@ + + + + + + + + + + +MozUpdates :: Manage Application Versions + + + + + +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); +} +?> + + + + + + + + + + + + + +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + + $lastname = ""; + + while ($row = mysql_fetch_array($sql_result)) { + + // If it's a new AppName, start a new row + if ($lastname != $row["AppName"]) { + + // Close out previous row if necessary + if ($lastname != "") { + echo""; + echo"\n"; + } + + $applications[] = $row["AppName"]; + echo"\n"; + echo"\n"; + echo""; + echo""; + echo"\n"; + +?> +
Manage Application List:
ReleaseVersion
".++$i." ".$row["AppName"]."  "; + + } else { + + // Separate with a comma + + echo", "; + } + + echo""; + echo"".$row["Release"].""; + + if ($row["SubVer"] != "final") {echo"".$row["SubVer"]."";} + + echo""; + + $lastname = $row["AppName"]; + } + + echo"
+
+The application $_POST[AppName] (Version $_POST[Release]$_POST[SubVer]) has been successfully added.
"; + } +?> +
+New Application + Name: +Release: +GUID: +
+If other, Name: + + + + + +
+ + +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + + echo"
Your update to $_POST[AppName], has been successful.
"; + + } else if ($_POST["submit"] == "Delete Application") { + $sql = "DELETE FROM `t_applications` WHERE `appid`='$_POST[appid]'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + + echo"
You've successfully deleted the application '$_POST[AppName]'.
"; +} + +if (!$appid) { $appid = $_POST["appid"]; } +// Show Edit Form + $sql = "SELECT * FROM `t_applications` WHERE `appid` = '$appid' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + + $row = mysql_fetch_array($sql_result); +?> + +
+

Edit Application:

+
+
\n"; + echo"Release: "; + echo"
\n"; + + echo"GUID:
\n"; + + echo"\n"; +?> + + + + +
+«« Return to Application Manager +
+ + + + + + \ No newline at end of file diff --git a/mozilla/webtools/update/developers/approval.php b/mozilla/webtools/update/developers/approval.php new file mode 100755 index 00000000000..1e51d235219 --- /dev/null +++ b/mozilla/webtools/update/developers/approval.php @@ -0,0 +1,196 @@ + + + + +Mozilla Update :: Developer Control Panel :: Manage Approval Queue + + + + +

Extensions/Themes Awaiting Approval

+ + + + + + + + +\n"; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; + + } + +?> + +
NameRequested by?Last UpdatedWorks with
$i$row[Name] $row[Version]$row2[UserName] - $row2[UserEmail]$date$row[AppName]"; if($row[OSName] != "ALL") { echo" ($row[OSName])"; } echo"
+ $i) {$authors .=", ";} + } +$sql = "SELECT `UserName`, `UserEmail`,`date` FROM `t_approvallog` TA INNER JOIN t_userprofiles TU ON TA.UserID=TU.UserID WHERE `ID`='$id' AND `vID`='$_GET[vid]' AND `action`='Approval?' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $requestedby = $row["UserName"]; + $requestedon = $row["date"]; + $requestedbyemail = $row["UserEmail"]; +?> + +

Mozilla Update - Approval Requested:

+ + +
+
+"> +"> +"> +"> +"> +
+  name          
+  author(s)     
+  id            
+  version       
+  supported apps:
+                
+  requested by: 
+  requested on: 
+  
+  ">Install Now (KB)
+  Download
+  
+  Comments: 
+  
+   
+
+
+«« Return to Approval Queue +
+ +"; + + +//Firstly, log the comments and action taken.. +$_POST["userid"] = $_SESSION["uid"]; + +$sql = "INSERT INTO `t_approvallog` (`ID`, `vID`, `UserID`, `action`, `date`, `comments`) VALUES ('$_POST[id]', '$_POST[vid]', '$_POST[userid]', '$action', NOW(NULL), '$_POST[comments]');"; +$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + +//Secondly, let's move the file to it's new home in /ftp/ for staging... +$sql = "SELECT `Type`,`Name`,`Version`,`URI` from `t_main` TM INNER JOIN t_version TV ON TM.ID=TV.ID WHERE `vID`='$_POST[vid]' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $uri = $row["URI"]; + $filename = str_replace ("http://$sitehostname", "$websitepath", $uri); + if (file_exists($filename)) { +if ($row["Type"]=="T") {$type="themes";} else if ($row["Type"]=="E") {$type="extensions";} +$name = str_replace(" ","_",$row["Name"]); +$path = strtolower("$type/$name"); +//http://mozupdates.psychoticwolf.net/files/approval/chatzilla-0.9.63c-ff.xpi + $destination = str_replace("/files/approval",strtolower("/files/ftp/$path"),$filename); + +$dirpath = "$websitepath/files/ftp/$path"; +if (!file_exists($dirpath)) { +mkdir($dirpath,0775); +} +if (!file_exists($destination)) { +rename("$filename", "$destination"); +} + +$newurl = "http://ftp.mozilla.org/pub/mozilla.org"; +$uri = str_replace("$websitepath/files/ftp","$newurl","$destination"); +} + +//Thirdly, update version record... +$sql = "UPDATE `t_version` SET `URI`='$uri', `approved`='$approved' WHERE `ID`='$_POST[id]' AND `URI`='$row[URI]' LIMIT 5"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + + +@include"mail_approval.php"; + +echo"Processing Request...
\n"; +echo"Approval Flag set to $action, for $_POST[name] $_POST[version]
\n"; +echo"E-Mail sent to requestee informing them of the action taken along with your comments
\n"; +echo"«« Return to Approval Queue"; +echo""; + +} +?> + + + + + + \ No newline at end of file diff --git a/mozilla/webtools/update/developers/categorymanager.php b/mozilla/webtools/update/developers/categorymanager.php new file mode 100755 index 00000000000..b38a6f471a8 --- /dev/null +++ b/mozilla/webtools/update/developers/categorymanager.php @@ -0,0 +1,189 @@ + + + + + + + + + +Mozilla Update :: Category Manager + + + + + + +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); +} +?> + + + + + + + + + + + + +\n"; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; +} + +?> +
Manage Category List:  Show: "; +if ($types[$type]) {$type = $types[$type]; } + echo"$type"; + echo" / \n"; + } + echo"All\n"; +?>
NameDescriptionType
$i$catname$catdesc$cattype
+
+MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + + echo"
The category $_POST[catname] has been Successfully Added...
"; +} +?> +
+New Category + +Name: +Description:
+ +Type: +If other, Type: + +
+ + +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + + echo"
Your update to $_POST[catname], has been submitted successfully...
"; + +} else if ($_POST["submit"] == "Delete Category") { + $sql = "DELETE FROM `t_categories` WHERE `CategoryID`='$_POST[categoryid]'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + + echo"
You've successfully deleted the category '$_POST[catname]'...
"; +} + +if (!$categoryid) { $categoryid = $_POST["categoryid"]; } +// Show Edit Form + $sql = "SELECT * FROM `t_categories` WHERE `CategoryID` = '$categoryid' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + + $row = mysql_fetch_array($sql_result); + $categoryid = $row["CategoryID"]; + $catname = $row["CatName"]; + $catdesc = $row["CatDesc"]; + $cattype = $row["CatType"]; +?> + +
+

Edit Category:

+
+
\n"; + echo"Description:
\n"; + echo"Type: \n"; + echo"
\n"; +?> + + + +
+«« Return to Category Manager +
+MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + +// echo"
The category $_POST[catname] has been Successfully Added...
"; +//} +?> + +//

Add New Category:

+//
+//Name:
+//Description:
+//Type:
+// +// +//
+?> + + + + + \ No newline at end of file diff --git a/mozilla/webtools/update/developers/faqmanager.php b/mozilla/webtools/update/developers/faqmanager.php new file mode 100755 index 00000000000..2fd634306fa --- /dev/null +++ b/mozilla/webtools/update/developers/faqmanager.php @@ -0,0 +1,174 @@ + + + + + + + + + + +MozUpdates :: Manage Application Versions + + + + + + + + + + + + + + + + + + + + +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row = mysql_fetch_array($sql_result)) { + +//Create Customizeable Timestamp + $date = $row["lastupdated"]; + $day=substr($date,6,2); //get the day + $month=substr($date,4,2); //get the month + $year=substr($date,0,4); //get the year + $hour=substr($date,8,2); //get the hour + $minute=substr($date,10,2); //get the minute + $second=substr($date,12,2); //get the sec + $timestamp = strtotime("$year-$month-$day $hour:$minute:$second"); + $lastupdated = gmdate("F d, Y g:i:sa", $timestamp); + + $applications[] = $row["AppName"]; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; + +} +?> +
Manage FAQs:
FAQ EntryUpdatedActive
".++$i." ".$row["title"]."$lastupdated$row[active]
+
+ +
+New FAQ Entry + Title: + +
+
+ +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + + + echo"
Your update to $_POST[title], has been successful.
"; + + } else if ($_POST["submit"] == "Delete Entry") { + $sql = "DELETE FROM `t_faq` WHERE `id`='$_POST[id]'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + + echo"
You've successfully deleted the application '$_POST[AppName]'.
"; +} + +if (!$id) { $id = $_POST["id"]; } +// Show Edit Form + $sql = "SELECT * FROM `t_faq` WHERE `id` = '$id' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); +?> + +
+

Edit FAQ Entry:

+
+\n"; + echo"Title:
\n"; + echo"Index:   "; + echo"Alias:
"; + echo"Entry Text:
"; +$active = $row["active"]; +if ($active=="YES") { + echo"Yes: / No: "; + } else if ($active=="NO") { + echo"Yes: / No: "; + } else { + echo"Yes: / No: "; + } +?> +
+ + + +
+«« Return to FAQ Manager +
+ +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + + + echo"
The entry $_POST[title] has been successfully added.
"; + } +?> + +
+

Add FAQ Entry:

+
+
\n"; + echo"Index:   "; + echo"Alias:
"; + echo"Entry Text:
"; + echo"Yes: / No: "; +?> +
+ + + +
+«« Return to FAQ Manager +
+ + + + + + \ No newline at end of file diff --git a/mozilla/webtools/update/developers/inc_sidebar.php b/mozilla/webtools/update/developers/inc_sidebar.php new file mode 100755 index 00000000000..99a49cf387f --- /dev/null +++ b/mozilla/webtools/update/developers/inc_sidebar.php @@ -0,0 +1,31 @@ + +
+
diff --git a/mozilla/webtools/update/developers/index.php b/mozilla/webtools/update/developers/index.php new file mode 100755 index 00000000000..0834f698d7f --- /dev/null +++ b/mozilla/webtools/update/developers/index.php @@ -0,0 +1,56 @@ + + + + + +Mozilla Update :: Developer Control Panel + + +
+
+
+ +

About the Developer Control Panel

+ +
+
+

Developers Login

+ +You were not successfully logged in. Check your e-mail address and password and try again. + +You've been successfully logged out. + + + + + + + + + + + + + + +
E-Mail:
Password:
+ +
+ + + + diff --git a/mozilla/webtools/update/developers/itemoverview.php b/mozilla/webtools/update/developers/itemoverview.php new file mode 100755 index 00000000000..1d7c2489330 --- /dev/null +++ b/mozilla/webtools/update/developers/itemoverview.php @@ -0,0 +1,159 @@ + + + + +Mozilla Update :: Developer Control Panel :: Item Overview + + +
+

Item Overview ::

+Edit $name
\n"; +echo"$description
\n"; +if ($guid) {echo"GUID: $guid
\n"; } +if ($homepage) {echo"Homepage: $homepage
\n";} +echo"Categories: $categories
\n"; + +?> + +

Listed Versions

+"Pending Approval", "YES"=>"Approved", "NO"=>"Disabled"); +$sql = "SELECT vID, TV.Version, URI, OSName, approved FROM `t_version` TV +INNER JOIN t_os TOS ON TOS.OSID = TV.OSID +WHERE `ID`='$id' GROUP BY `URI` ORDER BY `Version`"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while($row = mysql_fetch_array($sql_result)) { + $vid = $row["vID"]; + $version = $row["Version"]; + $uri = $row["URI"]; + $filename = basename($row["URI"]); + $os = $row["OSName"]; + $approved = $row["approved"]; + $approved = $approved_array["$approved"]; + +echo"

Version $version - $approved

\n"; +echo"$filename - for $os
\n"; + + +$sql2 = "SELECT TV.Version, AppName, MinAppVer, MaxAppVer FROM `t_version` TV + INNER JOIN t_applications TA ON TA.AppID = TV.AppID + WHERE `ID`='$id' AND `URI`='$uri' ORDER BY TV.Version, TA.AppName"; + $sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while($row2 = mysql_fetch_array($sql_result2)) { + + $app = $row2["AppName"]; + $minappver = $row2["MinAppVer"]; + $maxappver = $row2["MaxAppVer"]; + + + echo"For $app:  $minappver - $maxappver
\n"; + + + } + + } +?> + + +
+
+

Statistics

+ Downloads this Week:
+ Total Downloads:
+
+ Rated: of 5
 
+
+ Comments:
 
+ +

Developer Comments

+\n"; } +} + +$sql = "SELECT `devcomments` FROM `t_main` WHERE `id`='$id' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $devcomments = $row["devcomments"]; + +?> +
"> +"> +
+  +
+ +

">Previews

+\"$caption\"
$caption\n"; + } + if (mysql_num_rows($sql_result)=="0") {echo"Add a Preview...
\n"; } +?> + + + +
+ + + + + \ No newline at end of file diff --git a/mozilla/webtools/update/developers/listmanager.php b/mozilla/webtools/update/developers/listmanager.php new file mode 100755 index 00000000000..079b0004a34 --- /dev/null +++ b/mozilla/webtools/update/developers/listmanager.php @@ -0,0 +1,579 @@ + + + + +Mozilla Update :: Developer Control Panel :: List Manager + + +"Extensions","T"=>"Themes"); +if (!$_GET["type"]) {$_GET["type"]="E";} +?> + +

Manage :

+" style="font-weight: bold;">Add New Item | Show: $typename) { +$i++; +echo"$typename"; +if ($i !== $count) {echo" / "; } + +} +unset($i); +?> + + + + + + + + + +\n"; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; +} +?> +
NameDescriptionLast Updated
$i$name$description$dateupdated
+
+
+New + Input File: +"> + +
+
+"; + echo"

Updating $name, please wait...

"; +if ($_POST["name"] && $_POST["authors"] && $_POST["categories"] && $_POST["description"]) { +//Everything We *must* have is present... Begin.... + +//Phase One, update t_main values... + $sql = "UPDATE `t_main` SET `Name`= '$_POST[name]', `Homepage`='$_POST[homepage]', `Description`='$_POST[description]', `DateUpdated`=NOW(NULL) WHERE `ID`='$_POST[id]' LIMIT 1"; + //echo"$sql
\n"; //Debug + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); +if ($sql_result) { + echo"Your update to $_POST[name] has been submitted successfully...
\n"; +} +echo""; + +//Phase Two, Author List -- Autocomplete and Verify + $authors = $_POST["authors"]; + $authors = explode(", ","$authors"); +foreach ($authors as $author) { +if (strlen($author)<2) {continue;} //Kills all values that're too short.. +$a++; + $sql = "SELECT `UserID`,`UserEmail` FROM `t_userprofiles` WHERE `UserEmail` LIKE '$author%' ORDER BY `UserMode`, `UserName` ASC"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $numresults = mysql_num_rows($sql_result); + while ($row = mysql_fetch_array($sql_result)) { + $userid = $row["UserID"]; + $useremail = $row["UserEmail"]; + if ($numresults>1) { + //Too many e-mails match, store individual data for error block. + $r++; + $emailerrors[$a]["foundemails"][$r] = $useremail; + } + $authorids[] = $userid; + } + if ($numresults !="1") { + //No Valid Entry Found for this E-Mail or too many, kill and store data for error block. + $emailerrors[$a]["author"] = "$author"; + $updateauthors = "false"; // Just takes one of these to kill the author update. + } +} +unset($a,$r); + +//Commit Updates to AuthorXref tables.. with the ID and UserID. +if ($updateauthors != "false") { + //Remove Current Authors + $sql = "DELETE FROM `t_authorxref` WHERE `ID` = '$_POST[id]'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + + //Add New Authors based on $authorids + sort($authorids); + foreach ($authorids as $authorid) { + $sql = "INSERT INTO `t_authorxref` (`ID`, `UserID`) VALUES ('$_POST[id]', '$authorid');"; + $result = mysql_query($sql) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + } + echo"Authors for $_POST[name]'s updated...
\n"; +} else { + echo"ERROR: Could not update Authors list, please fix the errors printed below and try again...
\n"; +} + +unset($authors); //Clear from Post.. + +//Phase Three, Category List, update linkages. +//print_r($_POST["categories"]); + //Delete Current Category Linkages... + $sql = "DELETE FROM `t_categoryxref` WHERE `ID` = '$_POST[id]'"; + //echo"$sql
\n"; //Debug + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + //Add New Categories from $_POST["categories"] + foreach ($_POST["categories"] as $categoryid) { + $sql = "INSERT INTO `t_categoryxref` (`ID`, `CategoryID`) VALUES ('$_POST[id]', '$categoryid');"; + //echo"$sql
\n"; //Debug + $result = mysql_query($sql) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + } + echo"Categories for $_POST[name]'s updated...
\n"; + +//End _POST if. + +} else { +//Something Isnt Present.. Throw the main error and details... + +echo"You're missing one or more required fields, please return to the previous page and correct the errors and try again...
\n"; +if (!$_POST["name"]) {echo"Name is required
\n";} +if (!$_POST["authors"]) {echo"Authors is required
\n";} +if (!$_POST["categories"]) {echo"Categories is required
\n";} +if (!$_POST["description"]) {echo"Description is required
\n";} +} + +echo"
"; + + + +} else if ($_POST["submit"]=="Delete") { +$name = $_POST["name"]; +$id = $_POST["id"]; + +echo"

Deleting $name, please wait...

\n"; + $sql = "SELECT `Version`, `URI` FROM `t_version` WHERE `ID`='$id' GROUP BY `URI` ORDER BY `Version` ASC"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row = mysql_fetch_array($sql_result)) { + $version = $row["Version"]; + $uri = $row["URI"]; + + //Delete File(s) from server + if (strpos("$uri","approvalfile.php/")) { + $file = str_replace("http://$sitehostname/developers/approvalfile.php/","$repositorypath/approval/",$uri); + } else if (strpos("$uri","ftp.mozilla.org")) { + $ftppath = $uri; + $file = str_replace("http://ftp.mozilla.org/pub/mozilla.org/","$repositorypath/ftp/",$uri); + } + + if (file_exists($file)) { + $unlink = unlink($file); + } else { + $file_exists = "false"; + } + + if ($file_exists == "false" or !$unlink) { + echo"Error! Encountered a problem when trying to delete associated files, files were not deleted successfully
\n"; + } else { + echo"Deleted $name $version (".basename($uri).") successfully...
\n"; + } + + } + if ($ftppath) { + $basename = basename($ftppath); + $ftppath = str_replace("/$basename","",$ftppath); + $ftppath = str_replace("http://ftp.mozilla.org/pub/mozilla.org","$repositorypath/ftp",$ftppath); + if (@rmdir($ftppath)) { + echo"Removed Directory for $name...
\n"; + } else { + echo"Warning! Unable to remove directory for $name. Directory may not be empty.
\n"; + } + } + + $sql = "DELETE FROM `t_main` WHERE `ID`='$id'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + if ($sql_result) { + echo"$name has been deleted...
\n"; + echo"«« Back to Main Page...
\n"; + include"$page_footer"; + echo"\n\n"; + exit; + } +} + + +//---------------------- +// END +//---------------------- + + + +//Get Parent Item Information +$id = $_GET["id"]; +if (!$id) {$id = $_POST["id"]; } +$sql = "SELECT TM.ID, TM.Type, TM.GUID, TM.Name, TM.Description, TM.DateAdded, TM.DateUpdated, TM.Homepage, TU.UserEmail FROM `t_main` TM +LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID +INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID +WHERE TM.ID = '$id' +ORDER BY `Type` , `Name` ASC "; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row = mysql_fetch_array($sql_result)) { + $v++; + $id = $row["ID"]; + $type = $row["Type"]; + $guid = $row["GUID"]; + $name = $row["Name"]; + $dateadded = date("l, F, j Y g:i:s",strtotime($row["DateAdded"])); + $dateupdated = date("l, F, j Y g:i:s",strtotime($row["DateUpdated"])); + $homepage = $row["Homepage"]; + $description = $row["Description"]; + $downloadcount = $row["DownloadCount"]; + $authors[$v] = $row["UserEmail"]; + } + unset($v); + +//Make Authors E-Mail Array into a Nice String +$num_authors = count($authors); +foreach($authors as $author) { +$v++; +$authorstring .= "$author"; +if ($v != $num_authors) { $authorstring .=", "; } +} +$authors = $authorstring; +unset($v); +?> +

+ +"> +"> + + + + + + + + + +\n"; +$authors = $_POST["authors"]; +} +?> + + + + + +
GUID:Categories:
    
Date Added:
Last Updated:
Name* " SIZE=50 MAXLENGTH=100>
\n"; +echo"
"; +echo"Errors Found in Authors
\n"; +echo"\n"; +foreach ($emailerrors as $authorerror) { +$author = $authorerror["author"]; +$count = count($authorerror["foundemails"]); + +if ($count=="0") { +//Error for No Entry Found +echo"Entry '$author': No Matches Found, Please check your entry and try again.
\n"; +} else { +//Error for Too Many Entries Found +echo"Entry '$author': Too Many Matches, Please make your entry more specific.
\n"; +} +if ($count>0 AND $count<6) { +echo"    Possible Addresses found: "; +foreach ($authorerror["foundemails"] as $foundemails) { +$a++; +echo"$foundemails"; + +if ($a != $count) {echo", "; } else {echo"
\n";} +} +} + +} +echo"
Author(s):*" SIZE=50>
Homepage " SIZE=50 MAXLENGTH=200>
Description*
    ? This action is not reversable and will remove all files and listed versions.');">
+   ">«« Back to Item Overview + +"; + echo"

Updating Version, please wait...

\n"; +//print_r($_POST); +//echo"

\n"; + +echo""; +//Phase One-Part 1 -- Version (per-file record update) +$notes = $_POST["notes"]; +$id = $_POST["id"]; +$uri = $_POST["uri"]; +$osid = $_POST["osid"]; + $sql = "UPDATE `t_version` SET `OSID`='$osid', `Notes`='$notes', `DateUpdated`=NOW(NULL) WHERE `ID`='$id' AND `URI`='$uri'"; + //echo"$sql
\n"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + echo"Version Notes and OS for $_POST[name] $_POST[version] updated...
\n"; + +//Phase Two -- Update Min/Max Versions + +//Construct Internal App_Version Arrays +$i=0; +$sql = "SELECT `int_version`, `major`, `minor`, `release`, `SubVer` FROM `t_applications` ORDER BY `AppName`, `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row = mysql_fetch_array($sql_result)) { + $i++; + $int_version = $row["int_version"]; + $subver = $row["SubVer"]; + $release = "$row[major].$row[minor]"; + if ($row["release"]) {$release = "$release.$row[release]";} + if ($subver !=="final") {$release="$release$subver";} + $app_internal_array[$release] = $int_version; + } + +//print_r($app_internal_array); + +for ($i = 1; $i <= $_POST[maxval]; $i++) { +unset($minappver_int,$maxappver_int); +$minappver = $_POST["minappver_$i"]; +$maxappver = $_POST["maxappver_$i"]; +$vid = $_POST["appvid_$i"]; +if ($app_internal_array["$minappver"]) {$minappver_int = $app_internal_array["$minappver"]; } +if ($app_internal_array["$maxappver"]) {$maxappver_int = $app_internal_array["$maxappver"]; } +if (!$minappver_int) {$minappver_int = $minappver;} +if (!$maxappver_int) {$maxappver_int = $maxappver;} + +if ($minappver && $maxappver) { + $sql = "UPDATE `t_version` SET `MinAppVer`='$minappver', `MinAppVer_int`='$minappver_int', `MaxAppVer`='$maxappver', `MaxAppVer_int`='$maxappver_int' WHERE `vID`='$vid'"; + //echo"$sql
\n"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + echo"Updated Target Application Values for Application $i...
\n"; +} else { +if (!$minappver) { echo"Error: Minimum Version is not specified or invalid
\n"; } +if (!$maxappver) { echo"Error: Maximum Version is not specified or invalid
\n"; } +} +} + +echo"
"; + + + +} else if ($_POST["submit"]=="Delete") { +$id = $_POST["id"]; +$uri = $_POST["uri"]; +$version = $_POST["version"]; +echo"

Deleting Version... Please wait...

\n"; +$sql = "SELECT `Name` FROM `t_main` WHERE `ID` = '$id'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $name = $row["Name"]; + + $sql = "DELETE FROM `t_version` WHERE `ID`='$id' AND `URI`='$uri'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + if ($sql_result) { + //Delete File from server + if (strpos("$uri","approvalfile.php/")) { + $file = str_replace("http://$sitehostname/developers/approvalfile.php/","$repositorypath/approval/",$uri); + } else if (strpos("$uri","ftp.mozilla.org")) { + $file = str_replace("http://ftp.mozilla.org/pub/mozilla.org/","$repositorypath/ftp/",$uri); + } + + if (file_exists($file)) { + $unlink = unlink($file); + } else { + $file_exists = "false"; + } + + if ($file_exists == "false" or !$unlink) { + echo"Error! Encountered a problem when trying to delete associated files, files were not deleted successfully
\n"; + } + + echo"
$name $version has been deleted...
+ «« Back to the $name overview page...
"; + include"$page_footer"; + echo""; + exit; + } +} + + +//---------------------- +// END +//---------------------- + +//Get Parent Item Information +$id = $_GET["id"]; +if (!$id) {$id = $_POST["id"]; } +$sql = "SELECT TM.ID, TM.Name FROM `t_main` TM WHERE TM.ID = '$id' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $id = $row["ID"]; + $name = $row["Name"]; + + +//----------------------- +// Version Table +//----------------------- +$vid = $_GET["vid"]; +if (!$vid) {$vid = $_POST["vid"]; } +//Get Data for Form Population +//INNER JOIN t_main TM ON TV.ID = TM.ID + $sql = "SELECT `Version`, TV.OSID, `OSName`,`URI`,`Notes`,`Size`,`DateAdded`, `DateUpdated` FROM `t_version` TV INNER JOIN `t_os` TOS ON TOS.OSID=TV.OSID WHERE `vID` = '$vid' ORDER BY `Version` ASC LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $v++; + $version=$row["Version"]; + $osid=$row["OSID"]; + $osname=$row["OSName"]; + $minappver=$row["MinAppVer"]; + $maxappver=$row["MaxAppVer"]; + $uri=$row["URI"]; + $filename=basename($row["URI"]); + $notes=$row["Notes"]; + $size=$row["Size"]; + +?> +

+ +"> +\n"; + echo"\n"; + echo"\n"; + echo"\n"; + + + +//Construct App_Versions Arrays +$i=0; +$sql = "SELECT `AppName`, `Version`, `major`, `minor`, `release`, `SubVer` FROM `t_applications` ORDER BY `AppName`, `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row = mysql_fetch_array($sql_result)) { + $i++; + $application = strtolower($row["AppName"]); + $display_version = $row["Version"]; + $subver = $row["SubVer"]; + $release = "$row[major].$row[minor]"; + if ($row["release"]) {$release = "$release.$row[release]";} + if ($subver !=="final") {$release="$release$subver";} + $app_ver_array[$application][] = $release; + $app_display_array[$application][$release] = $display_version; + } + +$i=0; +echo"\n"; + $sql = "SELECT vID, TV.AppID,`AppName`,`MinAppVer`,`MaxAppVer` FROM `t_version` TV INNER JOIN `t_applications` TA ON TA.AppID=TV.AppID WHERE `ID` = '$id' && TV.URI = '$uri' ORDER BY `AppName` ASC"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row = mysql_fetch_array($sql_result)) { + $i++; + $appname = $row["AppName"]; + $appid=$row["AppID"]; + $minappver=$row["MinAppVer"]; + $maxappver=$row["MaxAppVer"]; + + echo"\n"; + +} + echo""; + echo"\n"; + echo"\n"; +?> + + + + +
$filename ($size"."kb)
Target Application(s):
$appname "; + echo""; + echo"\n"; + echo" - "; + + echo"\n"; + echo"
OS*"; + echo"\n"; + echo"
Version Notes:
    ?');">
+   ">«« Back to Item Overview + + + + + + \ No newline at end of file diff --git a/mozilla/webtools/update/developers/login.php b/mozilla/webtools/update/developers/login.php new file mode 100755 index 00000000000..d332bf788ee --- /dev/null +++ b/mozilla/webtools/update/developers/login.php @@ -0,0 +1,44 @@ +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $num = mysql_num_rows($sql_result); + +if ($num == 1) { + +$row = mysql_fetch_array($sql_result); + +$userid=$row["UserID"]; +$useremail=$row["UserEmail"]; +$username=$row["UserName"]; +$usermode=$row["UserMode"]; +$usertrusted=$row["UserTrusted"]; +$logoncheck="YES"; + +//User Role to Session Level variable... +$rolearray = array("A"=>"admin", "E"=>"editor","U"=>"user"); +$usermode = $rolearray[$usermode]; + +//Register Session Variables +$_SESSION["uid"] = "$userid"; +$_SESSION["email"] = "$useremail"; +$_SESSION["name"] = "$username"; +$_SESSION["level"] = "$usermode"; +$_SESSION["trusted"] = "$usertrusted"; +$_SESSION["logoncheck"] = "$logoncheck"; + +$return_path="developers/main.php"; + +header("Location: http://$_SERVER[HTTP_HOST]/$return_path"); +exit; + + +} else { +$return_path ="developers/index.php?login=failed"; +header("Location: http://$_SERVER[HTTP_HOST]/$return_path"); +exit; +} +?> \ No newline at end of file diff --git a/mozilla/webtools/update/developers/logout.php b/mozilla/webtools/update/developers/logout.php new file mode 100755 index 00000000000..ddc895aa4cc --- /dev/null +++ b/mozilla/webtools/update/developers/logout.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/mozilla/webtools/update/developers/main.php b/mozilla/webtools/update/developers/main.php new file mode 100755 index 00000000000..02d086d20d1 --- /dev/null +++ b/mozilla/webtools/update/developers/main.php @@ -0,0 +1,110 @@ + + + + +Mozilla Update :: Developer Control Panel :: Overview + +

Welcome !

+ +

+ +Approval Queue Status: Pending Approval + + +

My Extensions

+ +$name\n"; +echo"$description\n"; +//Icon Bar +echo"
"; +echo""; +echo"
\"\"Downloads: $downloadcount
  $totaldownloads total
"; +echo""; +echo"
"; + +} +?> +    Add New Extension... +

+

+ +

My Themes

+$name\n"; +echo"$description\n"; +//Icon Bar +echo"
"; +echo""; +echo"
\"\"Downloads: $downloadcount
  $totaldownloads total
"; +echo""; +echo"
"; + + +} +?> +    Add New Theme... + +

+ + + + \ No newline at end of file diff --git a/mozilla/webtools/update/developers/osmanager.php b/mozilla/webtools/update/developers/osmanager.php new file mode 100755 index 00000000000..7d7b189b8ac --- /dev/null +++ b/mozilla/webtools/update/developers/osmanager.php @@ -0,0 +1,153 @@ + + + + + + + + + + +MozUpdates :: Manage Operating Systems + + + + + + +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + } +?> + + + + + + + + + + +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + + + while ($row = mysql_fetch_array($sql_result)) { + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; + } +?> + +
Manage OS List:
Name
".++$i."".$row["OSName"]."
+
+MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + + echo"
The OS $_POST[osname] has been successfully added.
"; + } +?> +
+Add New OS: + +Name: + +
+ +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + + + echo"
Your update to $_POST[osname], has been successful.
"; + + } else if ($_POST["submit"] == "Delete OS") { + $sql = "DELETE FROM `t_os` WHERE `OSID`='$_POST[osid]'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + + echo"
You've successfully deleted the operating system '$_POST[osname]'.
"; +} + +if (!$osid) { $osid = $_POST["osid"]; } +// Show Edit Form + $sql = "SELECT * FROM `t_os` WHERE `OSID` = '$osid' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + + + $row = mysql_fetch_array($sql_result); +?> + +
+

Edit OS:

+
+\n"; + echo"
\n"; +?> + + + + +
+«« Return to OS Manager +
+ +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); +// + +// echo"
The OS $_POST[osname] has been successfully added.
"; +// } +?> + +//

Add New Operating System:

+//
+//Name:
+// +// +//
+// +?> + + + + + \ No newline at end of file diff --git a/mozilla/webtools/update/developers/previews.php b/mozilla/webtools/update/developers/previews.php new file mode 100755 index 00000000000..387d9e310c5 --- /dev/null +++ b/mozilla/webtools/update/developers/previews.php @@ -0,0 +1,255 @@ + + + + +Mozilla Update :: Developer Control Panel :: Item Previews + + + +

Item Previews ::

+\n"; + +} + + +unset($i); +$sql = "SELECT * FROM `t_previews` TP WHERE `ID`='$id' ORDER BY `PreviewID`"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $num_results = mysql_num_rows($sql_result); + +if ($num_results>"0") { +?> +
&function=updatepreviews"> +$dest_height_fixed) { + $dest_height = $dest_height_fixed; + $dest_width = ($src_width * $dest_height) / $src_height; + } + } + +echo"

Preview #$i - $caption

\n"; +echo"$filename ($src_width x $src_height) $filesize"."Kb"; if ($preview=="YES") {echo" (List Page Preview)";}echo"
\n"; +if ($nopopup != "true") {echo"";} +echo"\"$caption\""; +if ($nopopup != "true") {echo"";} +echo"
\n"; +echo"\n"; +echo"Edit Caption: "; +if ($preview == "YES" OR ( $src_width<="175" AND $src_height <="80")) { +echo"  List Page Preview?
\n"; +} else { echo"
\n"; } +echo"Delete File?
\n"; +} +?> +"0") { ?> +"> +
+
+ + +

Add Preview

+$dest_height_fixed) { +$dest_height = $dest_height_fixed; +$dest_width = ($src_width * $dest_height) / $src_height; +} +$quality="80"; // JPEG Image Quality +$outputpath="$websitepath/$previewpath"; //path of output image ;-) + +if ($type=="2") { +$src_img = imagecreatefromjpeg("$sourcepath"); +} else if ($type=="3") { +$src_img = imagecreatefrompng("$sourcepath"); +$quality="95"; +} +$dst_img = imagecreatetruecolor($dest_width,$dest_height); +imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width, $dest_height, $src_width, $src_height); +imageinterlace($dst_img, 1); +$white = ImageColorAllocate($dst_img, 255, 255, 255); +//Make a couple of size corrections for the auto-border feature.. +$dest_width = $dest_width-1; +$dest_height = $dest_height-1; +imagerectangle ($dst_img, 0, 0, $dest_width, $dest_height, $white); +$status = imagejpeg($dst_img, "$outputpath", $quality); +imagedestroy($src_img); +imagedestroy($dst_img); + +if ($status=="1") { +//Lets attempt to add the record to the DB. +$sql = "INSERT INTO `t_previews` (`PreviewURI`,`ID`,`caption`,`preview`) VALUES ('/$previewpath','$id','$caption','$preview');"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + +if ($sql_result=="1") { +echo"Your File $filename ($filesize bytes) has been successfully uploaded and added to the database. Click here to refresh this page to show the added entry for editing.

"; +} + +} +} else { +echo"The image you uploaded has errors and could not be processed successfully. The image may be corrupt or not in the correct format. This tool only supports jpeg and png images. Please try your operation again.

\n"; + +} + +} + +?> + +
&function=addpreview" enctype="multipart/form-data"> +Only PNG or JPG images are supported for addition to the preview screenshots page for your item. Check the "List Page Preview" box +if you'd like the image to be featured on the list and the top of the item details pages. To just have it added to your screenshots +page, leave the box unchecked
+ List Page Preview?
+ +Image Width: x Height:
+Leave Width and Height at 0 for full-size. This setting is ignored for preview images, which have strict size requirements.

+ +Image Caption:
+ + +
+ + + \ No newline at end of file diff --git a/mozilla/webtools/update/developers/usermanager.php b/mozilla/webtools/update/developers/usermanager.php new file mode 100755 index 00000000000..5661ab976a5 --- /dev/null +++ b/mozilla/webtools/update/developers/usermanager.php @@ -0,0 +1,396 @@ + + + + + + +MozUpdates :: Manage Users + + + + + + + +
+\n"; + +if ($admin=="TRUE") { $mode="A"; +} else if ($editor=="TRUE") { $mode="E"; +} else if ($disabled=="TRUE") {$mode="D"; +} else { $mode="U"; } + +if ($trusted !=="TRUE") {$trusted="FALSE"; } + +$sql = "UPDATE `t_userprofiles` SET `UserMode`= '$mode', `UserTrusted`= '$trusted' WHERE `UserID`='$i'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + +} +unset($i); + +echo"Your changes to the User List have been succesfully completed
"; + +//Do Special Disable, Delete, Enable Account Operations +if ($_POST["selected"] AND $_POST["submit"] !=="Update") { +//$selected = $_POST["selected"]; + +if ($_POST["submit"]=="Disable Selected") { +$sql = "UPDATE `t_userprofiles` SET `UserMode`= 'D' WHERE `UserID`='$_POST[selected]'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); +echo"User Account for User Number $_POST[selected] Disabled
\n"; + +} else if ($_POST["submit"]=="Delete Selected") { +$sql = "DELETE FROM `t_userprofiles` WHERE `UserID`='$_POST[selected]' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); +echo"User Account for User Number $_POST[selected] Deleted
\n"; + +} else if ($_POST["submit"]=="Enable Selected") { +$sql = "UPDATE `t_userprofiles` SET `UserMode`= 'U' WHERE `UserID`='$_POST[selected]'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); +echo"User Account for User Number $_POST[selected] Enabled, User Mode set to User
\n"; +} + +} + +echo"
\n"; +} +?> + + + + + + + + + + + + +$maxuserid) {$maxuserid =$userid;} + +if ($usermode=="A") {$a="TRUE"; $e="TRUE"; +} else if ($usermode=="E") {$e="TRUE"; $a="FALSE"; +} else if ($usermode=="U") {$e="FALSE"; $a="FALSE"; +} else if ($usermode=="D") {$d="TRUE";} + $i++; + echo""; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; + + unset($a,$e,$t); +} + +echo""; + +?> + + + + +
Manage User List:
NameE-Mail AddressS E A T
$i  $username  $useremail"; + echo""; + echo""; + echo""; + if ($d=="TRUE") {echo"\n"; } + echo"
+ + + + +
+
+ +
+New User + E-Mail: + +
+
+ +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + echo"
Your update to $_POST[username], has been submitted successfully...
"; + +} else if ($_POST["submit"] == "Delete User") { +if ($_SESSION["level"] !=="admin" && $_SESSION["uid"] !== $_POST["userid"]) {$_POST["userid"]=$_SESSION["uid"];} + $sql = "DELETE FROM `t_userprofiles` WHERE `UserID`='$_POST[userid]'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + echo"
You've successfully deleted $_POST[username]...
"; +} + +if (!$userid) {$userid=$_POST["userid"];} + +//Show Edit Form + $sql = "SELECT * FROM `t_userprofiles` WHERE `UserID` = '$userid' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $userid = $row["UserID"]; + $username = $row["UserName"]; + $useremail = $row["UserEmail"]; + $userwebsite = $row["UserWebsite"]; + $userpass = $row["UserPass"]; + $usermode = $row["UserMode"]; + $trusted = $row["UserTrusted"]; + $useremailhide = $row["UserEmailHide"]; +?> + + + + +\n"; + echo"\n"; + echo"\n"; + echo"\n"; + echo"\n"; + + echo"\n"; + + echo"\n"; +?> + + + + + +
Edit Profile for :
Name:
E-Mail:
Website:
Password:Change Password
Permissions:"; +if ($_SESSION["level"]=="user" or $_SESSION[level]=="editor") { + if ($usermode=="U") {echo"User \n"; //To prevent being reset to null on submit. + } else if ($usermode=="E") { + echo"Editor \n"; + } else { + echo"Unknown \n"; + } + +if ($trusted=="TRUE") { + echo"Trusted \n"; +} + +} else if ($_SESSION["level"]=="admin") { + +if ($usermode=="A") {$a="TRUE"; $e="TRUE"; +} else if ($usermode=="E") {$e="TRUE"; $a="FALSE"; +} else if ($usermode=="U") {$e="FALSE"; $a="FALSE"; +} + + echo"Editor: \n "; + echo"Admin: \n "; + echo"Trusted: \n"; +} + echo"
E-Mail Public:"; + if ($useremailhide==="1") { + echo"Hidden: Visible: "; + } else if ($useremailhide==="0") { + echo"Hidden: Visible: "; + } else { + echo"Hidden: Visible: "; + } + echo"
    
«« Return to User Manager
+ +Your two passwords did not match, go back and try again..."; + } + + //Add User to MySQL Table +if ($errors !="true") { + $_POST["username"] = htmlspecialchars($_POST["username"]); + +$admin = $_POST["admin"]; +$editor = $_POST["editor"]; +$trusted = $_POST["trusted"]; +$disabled = $_POST["disabled"]; +//echo"$i - $admin - $editor - $trusted
\n"; + +if ($admin=="TRUE") { $mode="A"; +} else if ($editor=="TRUE") { $mode="E"; +} else if ($disabled=="TRUE") {$mode="D"; +} else { $mode="U"; } + +if ($trusted !=="TRUE") {$trusted="FALSE"; } + + + $sql = "INSERT INTO `t_userprofiles` (`UserName`, `UserEmail`, `UserWebsite`, `UserPass`, `UserMode`, `UserTrusted`, `UserEmailHide`) VALUES ('$_POST[username]', '$_POST[useremail]', '$_POST[userwebsite]', '$_POST[userpass]', '$mode', '$trusted', '$_POST[useremailhide]');"; + $result = mysql_query($sql) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + //include"mail_sendaccountdetails.php"; + echo"
The user $_POST[username] has been Successfully Added...
"; +} + +} +?> + + + + + + + + + + + + + + +
Add New User:
E-Mail:" SIZE=30 MAXLENGTH=100>
Name:
Website:
Password:
Confirm:  
Permissions:Editor: Admin: Trusted:
E-Mail Public:Hidden: Visible:
  
«« Return to User Manager
+ +"; + $sql = "SELECT `UserPass` FROM `t_userprofiles` WHERE `UserID` = '$_POST[userid]' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $userpass = $row["UserPass"]; + $oldpass = md5($_POST[oldpass]); + +if ($_SESSION["level"]=="admin") {$oldpass=$userpass; } //Bypass Old Password check for Admins only + if ($userpass==$oldpass) { + + if ($_POST[newpass]==$_POST[newpass2]) { + $userpass = md5($_POST["newpass"]); + $sql = "UPDATE `t_userprofiles` SET `UserPass`='$userpass' WHERE `UserID`='$_POST[userid]'"; + //echo"$sql\n
"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + echo"The password has been successfully reset.
"; + + } else { + echo"The two passwords did not match, please go back and try again."; + } + + + } else { + echo"Your Old password did not match the password on file, please try again."; + + } + echo"\n"; + +} + +if (!$userid) { $userid = $_POST["userid"]; } +//Get Name of User for Form + $sql = "SELECT `UserName` FROM `t_userprofiles` WHERE `UserID` = '$userid' LIMIT 1"; + $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + $row = mysql_fetch_array($sql_result); + $username = $row["UserName"]; +?> + + + + "> + + + + + + + + +
Change password for :
Old Password:
New Password:
Retype New Password:   
  
«« Return to User Manager
+ + + + + \ No newline at end of file diff --git a/mozilla/webtools/update/images/body_back.gif b/mozilla/webtools/update/images/body_back.gif new file mode 100755 index 00000000000..72a0d3ee6aa Binary files /dev/null and b/mozilla/webtools/update/images/body_back.gif differ diff --git a/mozilla/webtools/update/images/delete.png b/mozilla/webtools/update/images/delete.png new file mode 100755 index 00000000000..a9bb2d3b377 Binary files /dev/null and b/mozilla/webtools/update/images/delete.png differ diff --git a/mozilla/webtools/update/images/download_back.gif b/mozilla/webtools/update/images/download_back.gif new file mode 100755 index 00000000000..edd1a15cf94 Binary files /dev/null and b/mozilla/webtools/update/images/download_back.gif differ diff --git a/mozilla/webtools/update/images/download_br.gif b/mozilla/webtools/update/images/download_br.gif new file mode 100755 index 00000000000..318d0840649 Binary files /dev/null and b/mozilla/webtools/update/images/download_br.gif differ diff --git a/mozilla/webtools/update/images/edit.png b/mozilla/webtools/update/images/edit.png new file mode 100755 index 00000000000..243c671008c Binary files /dev/null and b/mozilla/webtools/update/images/edit.png differ diff --git a/mozilla/webtools/update/images/feature-back-cnet.png b/mozilla/webtools/update/images/feature-back-cnet.png new file mode 100755 index 00000000000..90deca5d2aa Binary files /dev/null and b/mozilla/webtools/update/images/feature-back-cnet.png differ diff --git a/mozilla/webtools/update/images/front-shop.gif b/mozilla/webtools/update/images/front-shop.gif new file mode 100755 index 00000000000..9ceba7185a1 Binary files /dev/null and b/mozilla/webtools/update/images/front-shop.gif differ diff --git a/mozilla/webtools/update/images/header_bl.png b/mozilla/webtools/update/images/header_bl.png new file mode 100755 index 00000000000..a8b7d27f3e5 Binary files /dev/null and b/mozilla/webtools/update/images/header_bl.png differ diff --git a/mozilla/webtools/update/images/header_br.gif b/mozilla/webtools/update/images/header_br.gif new file mode 100755 index 00000000000..175fa695a81 Binary files /dev/null and b/mozilla/webtools/update/images/header_br.gif differ diff --git a/mozilla/webtools/update/images/header_logo.gif b/mozilla/webtools/update/images/header_logo.gif new file mode 100755 index 00000000000..a2a2b1da206 Binary files /dev/null and b/mozilla/webtools/update/images/header_logo.gif differ diff --git a/mozilla/webtools/update/images/header_tab.gif b/mozilla/webtools/update/images/header_tab.gif new file mode 100755 index 00000000000..3d2a2e1c92d Binary files /dev/null and b/mozilla/webtools/update/images/header_tab.gif differ diff --git a/mozilla/webtools/update/images/header_tl.gif b/mozilla/webtools/update/images/header_tl.gif new file mode 100755 index 00000000000..3a43c715ba8 Binary files /dev/null and b/mozilla/webtools/update/images/header_tl.gif differ diff --git a/mozilla/webtools/update/images/header_tr.gif b/mozilla/webtools/update/images/header_tr.gif new file mode 100755 index 00000000000..7e30f7bc644 Binary files /dev/null and b/mozilla/webtools/update/images/header_tr.gif differ diff --git a/mozilla/webtools/update/images/key-point_back.gif b/mozilla/webtools/update/images/key-point_back.gif new file mode 100755 index 00000000000..979a984b4e5 Binary files /dev/null and b/mozilla/webtools/update/images/key-point_back.gif differ diff --git a/mozilla/webtools/update/images/key-point_bl.gif b/mozilla/webtools/update/images/key-point_bl.gif new file mode 100755 index 00000000000..fe6f825706f Binary files /dev/null and b/mozilla/webtools/update/images/key-point_bl.gif differ diff --git a/mozilla/webtools/update/images/key-point_br.gif b/mozilla/webtools/update/images/key-point_br.gif new file mode 100755 index 00000000000..2262148b72f Binary files /dev/null and b/mozilla/webtools/update/images/key-point_br.gif differ diff --git a/mozilla/webtools/update/images/key-point_tl.gif b/mozilla/webtools/update/images/key-point_tl.gif new file mode 100755 index 00000000000..87d7cd0d0e4 Binary files /dev/null and b/mozilla/webtools/update/images/key-point_tl.gif differ diff --git a/mozilla/webtools/update/images/key-point_tr.gif b/mozilla/webtools/update/images/key-point_tr.gif new file mode 100755 index 00000000000..8ce240790e8 Binary files /dev/null and b/mozilla/webtools/update/images/key-point_tr.gif differ diff --git a/mozilla/webtools/update/images/menu_back.gif b/mozilla/webtools/update/images/menu_back.gif new file mode 100755 index 00000000000..0afde1efd3a Binary files /dev/null and b/mozilla/webtools/update/images/menu_back.gif differ diff --git a/mozilla/webtools/update/images/menu_br.gif b/mozilla/webtools/update/images/menu_br.gif new file mode 100755 index 00000000000..d88a5a84fbc Binary files /dev/null and b/mozilla/webtools/update/images/menu_br.gif differ diff --git a/mozilla/webtools/update/images/menu_tr.gif b/mozilla/webtools/update/images/menu_tr.gif new file mode 100755 index 00000000000..0ceb90eea5f Binary files /dev/null and b/mozilla/webtools/update/images/menu_tr.gif differ diff --git a/mozilla/webtools/update/images/product-front-firefox.png b/mozilla/webtools/update/images/product-front-firefox.png new file mode 100755 index 00000000000..a9f360e859c Binary files /dev/null and b/mozilla/webtools/update/images/product-front-firefox.png differ diff --git a/mozilla/webtools/update/images/product-front-mozilla.png b/mozilla/webtools/update/images/product-front-mozilla.png new file mode 100755 index 00000000000..8badab15b35 Binary files /dev/null and b/mozilla/webtools/update/images/product-front-mozilla.png differ diff --git a/mozilla/webtools/update/images/product-front-thunderbird.png b/mozilla/webtools/update/images/product-front-thunderbird.png new file mode 100755 index 00000000000..85b122d130c Binary files /dev/null and b/mozilla/webtools/update/images/product-front-thunderbird.png differ diff --git a/mozilla/webtools/update/images/ratings.png b/mozilla/webtools/update/images/ratings.png new file mode 100755 index 00000000000..8b5a87c7824 Binary files /dev/null and b/mozilla/webtools/update/images/ratings.png differ diff --git a/mozilla/webtools/update/images/reply.png b/mozilla/webtools/update/images/reply.png new file mode 100755 index 00000000000..5022094a863 Binary files /dev/null and b/mozilla/webtools/update/images/reply.png differ diff --git a/mozilla/webtools/update/images/rss.png b/mozilla/webtools/update/images/rss.png new file mode 100755 index 00000000000..382946ace7b Binary files /dev/null and b/mozilla/webtools/update/images/rss.png differ diff --git a/mozilla/webtools/update/images/shop_back.gif b/mozilla/webtools/update/images/shop_back.gif new file mode 100755 index 00000000000..1834563397d Binary files /dev/null and b/mozilla/webtools/update/images/shop_back.gif differ diff --git a/mozilla/webtools/update/images/shop_br.gif b/mozilla/webtools/update/images/shop_br.gif new file mode 100755 index 00000000000..37c3985472a Binary files /dev/null and b/mozilla/webtools/update/images/shop_br.gif differ diff --git a/mozilla/webtools/update/images/shop_tl.gif b/mozilla/webtools/update/images/shop_tl.gif new file mode 100755 index 00000000000..2015e6dd310 Binary files /dev/null and b/mozilla/webtools/update/images/shop_tl.gif differ diff --git a/mozilla/webtools/update/images/t_featuring.gif b/mozilla/webtools/update/images/t_featuring.gif new file mode 100755 index 00000000000..d5edfb7309a Binary files /dev/null and b/mozilla/webtools/update/images/t_featuring.gif differ diff --git a/mozilla/webtools/update/images/t_firefox.gif b/mozilla/webtools/update/images/t_firefox.gif new file mode 100755 index 00000000000..37cb47502cb Binary files /dev/null and b/mozilla/webtools/update/images/t_firefox.gif differ